User Tools

Site Tools


services:nodeserve

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
services:nodeserve [2024/08/13 11:39] jasservices:nodeserve [2024/08/13 11:48] (current) – [Nodeserve] jas
Line 13: Line 13:
   % mkdir ~/nodejs/app1   % mkdir ~/nodejs/app1
  
-3.  In each app directory, create a package.json file using the **npm init -y** command.  Using the "-y" option stops npm from asking you questions such as version, description, author, etc. and uses the defaults.+3.  Change into your app directory, and create a //package.json// file using the **npm init -y** command.  Using the "-y" option stops npm from asking you questions such as version, description, author, etc. and uses the defaults.
  
-4.  Develop your Node.js app.  You can use **npm install** to install whatever packages you need.+  % cd ~/nodejs/app1 
 +  % npm init -y 
 +   
 +4.  Develop your app.  You can use **npm install** to install whatever packages you need.
  
 5.  Test your app on any EECS machine.  It's harder to debug your app when it's running on the server, so it makes sense to do most of your debugging locally. 5.  Test your app on any EECS machine.  It's harder to debug your app when it's running on the server, so it makes sense to do most of your debugging locally.
Line 63: Line 66:
 7.  Visit your app on the web by visiting:  https://nodeserve.eecs.yorku.ca/<user>/<app> where <user> is your EECS username, and <app> is your application name.   7.  Visit your app on the web by visiting:  https://nodeserve.eecs.yorku.ca/<user>/<app> where <user> is your EECS username, and <app> is your application name.  
  
-The web server will look up the port number allocated to your app, and set the port number in the PORT environment variable.  It will start running your app.  It will forward client requests from https://nodeserve.eecs.yorku.ca/<user>/<app> to your application running on http://localhost:port.+The web server will look up the port number allocated to your app, and set the port number in the PORT environment variable.  It will start running your app.  It will forward client requests from https://nodeserve.eecs.yorku.ca/<user>/<app> to your application running on http://localhost:<port>.
  
 A few additional notes: A few additional notes:
services/nodeserve.1723563564.txt.gz · Last modified: 2024/08/13 11:39 by jas

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki