Skip to content

Node.js application error message: "Cannot GET" URL

When running a Node.js application through the Node.js Selector in cPanel, you may encounter the error:

This means the application received a request for a URL path, but no route was defined to handle it.

  • Missing Route Definition → The requested URL path is not defined in your application code.
  • Incorrect Startup File → The file specified in the Node.js Selector (e.g., app.js or server.js) does not contain the correct routing logic.
  • Wrong Application Root → Files are not located in the directory set as the application root.
  • Port or Path Issues → The app is listening on a port or path that doesn’t match the request.

Make sure your application defines routes for the requested URL. Example using Express.js:

const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.get('/myapp', (req, res) => {
res.send('This is my app route.');
});
app.listen(3000, () => {
console.log('App running on port 3000');
});

If you visit /myapp, the app must have a corresponding app.get('/myapp', ...) route.

  • In cPanel → Setup Node.js App, confirm the Application Startup File points to the correct file (e.g., app.js or server.js).
  • Ensure this file contains the routing logic.
  • Verify that your app files are inside the directory specified as the Application Root in Node.js Selector.
  • If files are in a subfolder, update the root path or move them accordingly.
  • After making changes, restart the app from Node.js Selector → Restart App.
  • This reloads the configuration and applies your fixes.