Deploy SSR applications using Supervisord16th June 2019
Deploy SSR Applications using Supervisord
If you’re building Server-Side Rendering applications with React (next.js) or Vue.js (nuxt.js) you will have to deploy it using some process control tool to keep it running. I have seen that a lot of websites are teaching how to do this with PM2, but I decided to deploy SSR applications using Supervisord. It will work in the same way and it’s a very common tool, so chances are you already have Supervisord in your server. Especially you’ve followed the Deploy For Kids tutorial
sudo apt-get install supervisor
Now, create a new configuration file for your SSR application:
sudo vi /etc/supervisor/conf.d/my-ssr-app.conf
That’s the content:
command=npm run start
Now, you have to tell Supervisord about this new process:
sudo supervisorctl reread
sudo supervisorctl update
And if in the future you need to restart just your app, use the name in the conf file:
sudo supervisorctl restart myappname
That’s it. Now you know how to deploy SSR applications using Supervisord.
Server Side Rendering pros and cons. When to use it and when to choose something else
Originally published at Fernando Alves.
Deploy SSR applications using Supervisord was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.