NODE JS: My node application runs when I run from cPanel terminal, BUT when I run from application manager it does not get the path.

Operating System & Version
Cent OS
cPanel & WHM Version
cPanel & WHM104

Ahsanul Hoque

Registered
Aug 1, 2018
4
0
1
Bangladesh
cPanel Access Level
Website Owner
NODE JS application is not Running after registering from Application Manager.
1. create a directory nodejsapp in home (not in public_html)
2. Configure in Application Manager
3. Node runs but it shows "Cannot GET /nodeapps"

How to locate the nodejsapp in home directory?

app.js
const express =require('express');
const app = express(); // initialize express
const PORT = 3000;

app.get('/', function (req,res){
res.send(' Node Is WORKING...' + PORT)
});
 
Last edited by a moderator:

Ahsanul Hoque

Registered
Aug 1, 2018
4
0
1
Bangladesh
cPanel Access Level
Website Owner
My node application when run from cPanel terminal it works, but when run from application manager it does not get the path.

const express =require('express');
const app = express();
const PORT = 5000;



app.get('/', function (req,res){
res.send('Node Response is WORKING...')
});


Result Shows:
Cannot GET /nodeapps

I tried both ways by putting the nodeapps forder in HOME directory and also under public_html
 
Last edited: