0

i want to run the node application in cPanel server how to configure and run node application in cPanel server.

1 Answer 1

3

You should add the following code in the .htaccessfile where XXXXX is the port number

    RewriteEngine On
    RewriteRule ^$ http://127.0.0.1:XXXXX/ [P,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ http://127.0.0.1:XXXXX/$1 [P,L]

Then you should type in your terminal

    nohup npm start & 

and in your package.json don't forget to add this script

    "start": "nodemon index.js --exec babel-node --presets es2015,stage-2"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.