User Tools

Site Tools


nodejs:production-mode

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
nodejs:production-mode [2024/04/04 05:40] kirtisinghnodejs:production-mode [2024/04/05 00:26] (current) kirtisingh
Line 17: Line 17:
 {{:nodejs:dev-form-prod.png?direct&400|}} {{:nodejs:dev-form-prod.png?direct&400|}}
  
-**Important point :**\\+**Important points :**\\
   - Select the User/VHost (website)\\    - Select the User/VHost (website)\\ 
   - Enter the ‘App Web path’ . This would be like /app1 or /app2 or it can even be the website root i.e. /\\   - Enter the ‘App Web path’ . This would be like /app1 or /app2 or it can even be the website root i.e. /\\
Line 24: Line 24:
   - Under the production filesystem path, enter the folder containing the app w.r.t. /home/{username}/node_apps/ . So in our case it is app1   - Under the production filesystem path, enter the folder containing the app w.r.t. /home/{username}/node_apps/ . So in our case it is app1
   - Also finally select the Nodejs version that you wish to use with the App   - Also finally select the Nodejs version that you wish to use with the App
 +
 +In production mode the Node app runs w.r.t. system path reference. **To put it simply you need to ensure that any file references in your code, are absolute and not relative.** Lets say your Node app start point is /home/user1/node_apps/app1/server.js , and your server.js refers to contents.json , you would need to change it to /home/user1/node_apps/app1/contents.json .  
  
 With the above steps, you have mapped the web-server's VHost/Website’s URL part to the to the specified port of the App, which will be launched by our environment from the specified source folder With the above steps, you have mapped the web-server's VHost/Website’s URL part to the to the specified port of the App, which will be launched by our environment from the specified source folder
  
 To manage the App process, you can do the same from within Node Apps -> App : Manage App State To manage the App process, you can do the same from within Node Apps -> App : Manage App State
nodejs/production-mode.1712209219.txt.gz · Last modified: 2024/04/04 05:40 by kirtisingh

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki