0 points

javascript - Sending a JSON file to Express server using JS - Stack Overflow


dashboard

Sat Aug 08 2020 04:13:10 GMT+0000 (UTC)

Posted by @rdemo #javascript

const data = require('/path/to/data.json')

app.get('/search', function (req, res) {
  res.header("Content-Type",'application/json');
  res.send(JSON.stringify(data));
})
content_copy Copy

https://stackoverflow.com/questions/44849082/sending-a-json-file-to-express-server-using-js