How use Adonis in production?

#1

Hello,

How use adonis serve in production ?
I want keep watcher too.
Daemon?

I pull git repository on my VPS and I want refresh server automatically…

Thanks for your help.
Maxence.

0 Likes

#2

Use https://github.com/Unitech/pm2

0 Likes

#3

Hi guys

Exactly You need PM2 because this tool maintains your app running althoug you close your connection to the server.

Run once adonis serve --dev and after put to PM2 to work

0 Likes

#4

Wich command I must type to use adonis serve and PM2?

0 Likes

#5

If you try to google on how to use pm2 with Node.js, you will get it answer

0 Likes

#6

Yes, I know how to use PM2, I already used this. But how use PM2 with Adonis command?

0 Likes

#7

There is no need to use it with Adonis command, all you need it start the server using pm2

pm2 start server.js
1 Like

#8

And I would say even better: pm2 start server.js --watch

0 Likes

#9

Why would u watch directories in production?

1 Like

#10

Hi!

I use pm2 as suggested, but strangely, I get this error when running adonis:
logger.transport is not defined inside config/app.js file
It is defined for sure. What’s wrong with it?

0 Likes

#11

What command exactly did you use. Please give us the full command you used.

0 Likes