File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Clone this repo, then inside of it:
20
20
21
21
```
22
22
npm install
23
- PORT=3333 npm start
23
+ PORT=3333 RESPONSE_STATUS=204 npm start
24
24
```
25
25
26
26
Then, watch the output to inspect incoming requests:
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const express = require('express');
2
2
const bodyParser = require ( 'body-parser' )
3
3
4
4
const port = process . env . PORT || 3333 ;
5
+ const responseStatus = + ( process . env . RESPONSE_STATUS || 200 ) ;
5
6
6
7
const app = express ( ) ;
7
8
@@ -25,7 +26,7 @@ ${headers.join("\n")}${req.body.constructor === Object && Object.keys(req.body).
25
26
` ) ;
26
27
27
28
// Always respond successful.
28
- res . sendStatus ( 200 ) ;
29
+ res . sendStatus ( responseStatus ) ;
29
30
} ) ;
30
31
31
32
app . listen ( port , ( err ) => {
You can’t perform that action at this time.
0 commit comments