server {
listen 80;
server_name mysite.com www.mysite.com;
add_header Strict-Transport-Security 'max-age=31536000' always;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
location / {
root /home/kentforth/webapps/mysite/dist;
index index.html index.htm;
proxy_pass http://123.534.65.77:3000;
}
error_log /var/log/nginx/vue-app-error.log;
access_log /var/log/nginx/vue-app-access.log;
}
router.get("/api/user/:id", (req, res) => {
// var params = [req.params.id]
const id = req.params.id
db.run('SELECT * FROM user where id = ?', [id], (err, row) => {
if (req.params.id !== row.id) {
res.status(400).json({"error": "error"});
console.log('error')
return;
}
res.status(200).json(row);
console.log(req.params.id)
console.log(row)
});
});