Calling node api through postman with response as enable javascript error
-
When calling API https://mywebsite.com/api/register through browser and it returns correct response from server as { "error": false, "message": "Hello World" }
If we hit the same request from postman then it returns with some html content as Please enable JavaScript to view the page content.
Below is node side code:var express = require("express");
var app = express();
var bodyParser = require("body-parser");
var router = express.Router();
var cors = require('cors');
app.use(cors());
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({ limit: '50mb', "extended": false }));
router.get("/", function (req, res) {
res.json({ "error": false, "message": "Hello World" });
});
app.use('/api', router);
app.listen(8080);The api working through the browser but not with postman. What will be the possible errors?
Please help. Thanks! -
@julian you may want to take this to stack overflow. This is a forum for NodeBB, the node based forum software, not a forum for node.js