Skip to content

Latest commit

 

History

History
50 lines (43 loc) · 1.38 KB

INSTALL.md

File metadata and controls

50 lines (43 loc) · 1.38 KB

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

Configure the reverse-proxy

  1. 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
    }
  }
  1. Enable it with a symbolic link
ln -s /etc/nginx/sites/sites-available/your_api.conf /etc/nginx/sites/sites-enabled/your_api.conf
  1. Restart NGINX
systemctl restart nginx
  1. (Optional) You can also include the ssl configuration in the configuration file or use CertBot.

Start the API

Instance a screen

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

Start the service

Enter your api screen you created previously don't forget to follow the Readme.md instructions

npm start