This usually happens because the application is configured to run from the root directory (/), while you're trying to access it through a subdirectory (/app).
Many frontend frameworks and backend applications generate asset URLs and routes based on their configured base path.
Here are a few things to check:
- Configure the correct application URL in cPanel's Node.js application settings.
- Update the frontend framework's base URL if it supports subdirectory deployment.
- Check whether Express routes need a common prefix.
- Verify that static file paths are correct.
- Review rewrite rules if your application uses custom
.htaccess configurations.
For example, an Express application can use a route prefix:
app.use('/app', require('./routes'));
Make sure your frontend asset paths and backend routes use the same deployment structure.