You might want to run the service in your local machine. This backend service runs on port :1235, meanhile another frontend service (pikopos-frontend) runs on port :8080.
Init MySQL
mysql -h localhost -u root -p < ./setup/deploy_00.00.001_init_schema.sql
Setting Up NGINX
Setting up NGINX so opening localhost:1111 will redirect to localhost:1235 for backend endpoints and localhost:8080 for frontend endpoints
Create a new file called pikopos in nginx's sites-available:
sudo touch /etc/nginx/sites-available/pikopos
sudo nano /etc/nginx/sites-available/pikopos
upstream pikopos {
server localhost:57672;
}
upstream frontend {
server localhost:8080;
}
server {
listen 1111;
location / {
proxy_pass http://frontend;
}
location ~ ^/(ping|auth|employee) {
proxy_pass http://pikopos;
}
}
Create a symbolic link in sites-enabled to pikopos file in sites-available:
The first command sudo nginx -t is used to test whether we have an error in the config or not. If there is no error, then we restart the nginx service by using sudo service nginx restart
We might want check whether the nginx service successfully running or not by checking it's status
sudo service nginx status
pres q to quit
TODO: create tunneling for login / or just inject cookie?