I have just deployed my first basic Adonis app to the production server.
When I serve it with node ace serve
it works fine, I can access it from browser.
I created a ecosystem.config.cjs
file (since I use typescript using a .js
extension raised errors) as it is explained in documentation:
ecosystem.config.js
module.exports = {
apps: [
{
name: 'web-app',
script: './server.js',
instances: 'max',
exec_mode: 'cluster',
autorestart: true,
},
],
}
And executed it with pm2 start ecosystem.config.js
.
I get the following error:
I tried to change the script line to:
:
script: 'node ace serve',
:
Now when I run pm2 it doesn’t raise any error immediately, but the application is not served, and when I do pm2 list
I see there is an error:
(then doing pm2 delete all
in order to stop these procceses).
Any idea how to solve this problem?