Open zsszatmari opened 9 years ago
Hi!
I would expect the following to return a http status code:
const express = require('express'); const app = express(); const Q = require('q'); app.use(require('express-promise')()); app.get('/index.html', function(req, res){ res.send(Q(new Error(401))); }); const port = Number(process.env.PORT || 3000); app.listen(port, function () { console.log("Listening on " + port); });
Instead I get '{}' as response body and 200 OK as status code. In fact, I see no way I see no way to return http status code as promise result. Is there an easy way I've overlooked? Thank You!
Hi!
I would expect the following to return a http status code:
Instead I get '{}' as response body and 200 OK as status code. In fact, I see no way I see no way to return http status code as promise result. Is there an easy way I've overlooked? Thank You!