tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.23k stars 468 forks source link

Node Js deployment in nginx - how to deploy subfolder API endpoint #1439

Closed SethuICOMM closed 2 years ago

SethuICOMM commented 2 years ago

Hi,

I have created sample node js api project and worked fine in local development server. when the code move to ubundu - nginx/node server for deployment and got some error while accessing below API

var express = require('express'); var app = express();

app.get('/', function (req, res) { res.send('Hello World!'); });

app.get('/url', function (req, res) { res.json(["Tony","Lisa","Michael","Ginger","Food"]); }); app.get('/url/api', function (req, res) { res.json(["Tony api","Lisa api","Michael","Ginger","Food"]); });

app.listen(9000, function () { console.log('Example app listening on port 9000!'); });

I can able to access route folder like "/" thro browser. When i click my endpoint like "http://192.168.0.15/url" then system downloads json file instead of printing JSON array in browser. When i check local development (my machine) i can able to see the result in browser.

How do i configure the same into webserver with reverse proxy configuration?

Software versions

dhensby commented 2 years ago

I'm afraid this doesn't have anything to do with the mssql library and I'm unable to help with this problem