We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4b193a commit c32b42aCopy full SHA for c32b42a
README.md
@@ -20,7 +20,7 @@ Clone this repo, then inside of it:
20
21
```
22
npm install
23
-PORT=3333 npm start
+PORT=3333 RESPONSE_STATUS=204 npm start
24
25
26
Then, watch the output to inspect incoming requests:
server.js
@@ -2,6 +2,7 @@ const express = require('express');
2
const bodyParser = require('body-parser')
3
4
const port = process.env.PORT || 3333;
5
+const responseStatus = +(process.env.RESPONSE_STATUS || 200);
6
7
const app = express();
8
@@ -25,7 +26,7 @@ ${headers.join("\n")}${req.body.constructor === Object && Object.keys(req.body).
`);
27
28
// Always respond successful.
- res.sendStatus(200);
29
+ res.sendStatus(responseStatus);
30
});
31
32
app.listen(port, (err) => {
0 commit comments