Node.js
From DreamFactory
Drewpearce (Talk | contribs) |
Drewpearce (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | === Node === | ||
# Get deb installer | # Get deb installer | ||
#* <source lang=bash>$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -</source> | #* <source lang=bash>$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -</source> | ||
Line 15: | Line 16: | ||
#* Apache | #* Apache | ||
#** <source lang="bash">$ sudo service apache2 restart</source> | #** <source lang="bash">$ sudo service apache2 restart</source> | ||
+ | |||
+ | |||
+ | === Node Modules === | ||
+ | Node modules need to be installed in the DreamFactory installation directory. For example to install lodash (used in most DF Node tutorials): | ||
+ | # Navigate to the install directory | ||
+ | #* <source lang="bash">$ cd /opt/dreamfactory</source> | ||
+ | # Install the module with NPM | ||
+ | #* <source lang="bash">$ npm install lodash</source> |
Revision as of 19:54, 11 November 2016
Node
- Get deb installer
-
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
-
- Install with Apt
-
$ sudo apt-get install -y nodejs
-
- Configure DreamFactory to use Node
-
$ cd /opt/dreamfactory
-
$ nano .env
- Locate the line that reads
##DF_NODEJS_PATH=/usr/local/bin/node
- Change it to read
DF_NODEJS_PATH=/usr/bin/node
- Save and exit the file
- Locate the line that reads
-
$ php artisan cache:clear
-
- Restart the PHP-FPM and Nginx or Restart Apache (whichever solution you're using.)
- Nginx
-
$ sudo service php7.0-fpm restart && sudo service nginx restart
-
- Apache
-
$ sudo service apache2 restart
-
- Nginx
Node Modules
Node modules need to be installed in the DreamFactory installation directory. For example to install lodash (used in most DF Node tutorials):
- Navigate to the install directory
-
$ cd /opt/dreamfactory
-
- Install the module with NPM
-
$ npm install lodash
-