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?
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