Webapp di valazco.it
https://valazco.it
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
6 months ago | |
---|---|---|
api | 7 months ago | |
assets | 6 months ago | |
config | 7 months ago | |
scripts | 2 years ago | |
tasks | 2 years ago | |
views | 6 months ago | |
.editorconfig | 2 years ago | |
.eslintignore | 2 years ago | |
.eslintrc | 2 years ago | |
.gitignore | 7 months ago | |
.htmlhintrc | 2 years ago | |
.lesshintrc | 2 years ago | |
.npmrc | 2 years ago | |
.sailsrc | 2 years ago | |
COPYING | 2 years ago | |
Gruntfile.js | 2 years ago | |
README.md | 2 years ago | |
app.js | 2 years ago | |
ecosystem.config.js.dist | 12 months ago | |
package-lock.json | 10 months ago | |
package.json | 10 months ago |
README.md
Run in local
Install node.js >= v8.17.0
npm install sails -g
git clone https://gitlab.com/val.az.co/app && cd app
npm install
sails lift
The app will run at http://localhost:1337
Run in PROD (basic nginx server)
- Use PM2 (https://pm2.keymetrics.io/)
- install nodejs, nginx, mariadb
- Create mysql db valazco with user valazco
cp local.js.dist local.js
- edit local.js
- create letsencrypt ssl certificate
- forward nginx proxy
Sample nginx configuration
`` upstream my_nodejs_upstream { server 127.0.0.1:1337; keepalive 64; }
server { listen 80 default_server; listen [::]:80 default_server; server_name valazco.it; return 301 https://$server_name$request_uri; }
server { listen 443 ssl;
server_name valazco.it;
ssl_certificate_key /etc/letsencrypt/live/valazco.it/privkey.pem;
ssl_certificate /etc/letsencrypt/live/valazco.it/fullchain.pem;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://my_nodejs_upstream/;
proxy_redirect off;
proxy_read_timeout 240s;
}
} ``
Latest steps
npm install pm2
git clone https://gitlab.com/val.az.co/app && cd app
npm install
pm2 start ecosystem.config.js --env production