nodejs:production-mode
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| nodejs:production-mode [2024/04/04 05:40] – kirtisingh | nodejs:production-mode [2026/03/19 10:00] (current) – kirtisingh | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| **Important - Before running your app in production mode, kindly test your app in development mode first. Only after extensive testing, you may then use the production mode.** | **Important - Before running your app in production mode, kindly test your app in development mode first. Only after extensive testing, you may then use the production mode.** | ||
| - | **Step 1 :** Log into N99panel. From under N99panel dashboard, click 'Node Apps' | + | **Step 1 :** Log into N99panel. From under N99panel dashboard, click 'Node.js Apps' |
| + | |||
| + | {{: | ||
| - | {{: | ||
| \\ | \\ | ||
| - | **Step 2 :** Now click 'Link a Node App | + | **Step 2 :** Now click 'Add a Node.js App' |
| + | |||
| + | {{: | ||
| - | {{: | ||
| \\ | \\ | ||
| **Step 3 :** Fill in the form as under | **Step 3 :** Fill in the form as under | ||
| - | {{:nodejs:dev-form-prod.png? | + | {{:nodejs:nj2-nodeappprod-form.png? |
| - | **Important | + | \\ |
| + | |||
| + | **Important | ||
| - 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. /\\ | ||
| - | - Enter the ‘App Port’ . The port entered under should be within the range of 40000 to 50000\\ | + | - Enter the ‘App Port’ . The port on which your App runs . You need to ensure that your App listens on interface 0.0.0.0 instead of 127.0.0.1 or localhost which typically are used\\ |
| - | - Select the ‘App Mode’. | + | - Select the ‘App Mode/Initiation’. It will be one of |
| - | - Under the production | + | |
| + | - 'npm start' command | ||
| + | - 'npm run dev' command | ||
| + | - A command after ' | ||
| + | - Under the Production | ||
| - 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 | ||
| + | - If you app use .env file(s), please provide its full path under 'Env Files' box. You may enter multiple .env files, one on each line | ||
| + | - Also if you wish, you can expose other directories of the user to your app. Lets say you are storing PDF files in / | ||
| + | |||
| + | 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 / | ||
| With the above steps, you have mapped the web-server' | With the above steps, you have mapped the web-server' | ||
| - | To manage the App process, you can do the same from within Node Apps -> App : Manage App State | + | **If your App is not working as expected, please visit the following article in order to debug it in production mode : [[: |
| + | |||
| + | To manage the App process, you can do the same from within | ||
nodejs/production-mode.1712209219.txt.gz · Last modified: 2024/04/04 05:40 by kirtisingh
