cd server
npm install
npm run start
http://nginx.org/en/download.html
nginx-1.16.1/conf/nginx.conf (windows10)
nginx detail
# ...
http {
# ...
limit_req_zone $binary_remote_addr zone=testZone:10m rate=10r/s;
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://localhost:4000;
# ...
}
location /recommend {
proxy_pass http://localhost:4000/recommend;
# ...
limit_req zone=testZone burst=5;
limit_req_status 429;
limit_req_log_level error;
}
# ...
}
}