Ali Usama
Ali Usama

Reputation: 11

Internal Server Error on cpannel in node js

i am kinda new in deployment of nodejs on c Pannel. I installed node js on c pannel and upload my code to c pannel. Only the default router work like

`app.get('/', (req,res)=>{
  return res.status(200).json({
            status: true,
            res: "Api is working",
            data: null
        });
    
});`

this route works only

`app.get('/', (req,res)=>{
  return res.status(200).json({
            status: true,
            res: "Api is working",
            data: null
        });
    
});`

Only this route works, even if i user

`app.get('/check', (req,res)=>{
  return res.status(200).json({
            status: true,
            res: "Api is working",
            data: null
        });
    
});`

it give me internal server error 500 and all other routes as well giving me Internal server error 500 // Auth Routes app.use('/api/auth', require('./Routes/Auth')); // Role Routes app.use('/api/role', require('./Routes/Roles'))

My Code Structure enter image description here

Upvotes: 0

Views: 667

Answers (0)

Related Questions