Install Node.js
Go on your Debian-based server console and type the following commands:
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs
Install NGINX
apt install nginx
- Create a configuration file
/etc/nginx/sites/sites-available/your_api.conf
server {
server_name _; # "_" is the default servername, you can replace it with your domain
location / {
proxy_pass http://localhost:9000/; # link to the api
}
}
- Enable it with a symbolic link
ln -s /etc/nginx/sites/sites-available/your_api.conf /etc/nginx/sites/sites-enabled/your_api.conf
- Restart NGINX
systemctl restart nginx
- (Optional) You can also include the ssl configuration in the configuration file or use CertBot.
screen -dmS <your-api-screen-name> # e.g.: screen -dmS urban-api
screen -r <your-api-screen-name> # e.g.: screen -r urban-api
- tip: to leave screen press Ctrl + A and Ctrl + D
- tip 2: if you forgot the name of your screen you can find it with
screen -list
Enter your api screen you created previously
don't forget to follow the Readme.md
instructions
npm start