I am getting my head around express and have this get method:
app.get('/myendpoint', function(req, res) {
var js= JSON.parse ({code: 'success', message:'Valid'});
res.status(200).json(js);
});
When this endpoint is hit I get an error:
_http_server.js:192
throw new RangeError(`Invalid status code: ${statusCode}`);
When I comment out the JSON.parse statement and replace the js for some valid json it has no issues? How can I fix this?