File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 1
1
# httpbin
2
2
3
- HTTP server for debugging clients
3
+ HTTP server for debugging clients.
4
+
5
+ ## Run the server
6
+
7
+ ``` shell
8
+ $ npx @buzuli/httpbin
9
+ ```
Original file line number Diff line number Diff line change @@ -19,6 +19,23 @@ function server (options = {}) {
19
19
20
20
const app = express ( )
21
21
22
+ const summary = 'Any route (other than GET /help) will respond with the ' +
23
+ 'normal response (JSON body detailing the request). Query parameters ' +
24
+ 'are used for all behavior modification.'
25
+
26
+ const params = {
27
+ delay : '[number] milliseconds to delay before seding a response' ,
28
+ status : '[number] HTTP status code to respond with'
29
+ }
30
+
31
+ app . get ( '/help' , ( req , res ) => {
32
+ res
33
+ . json ( {
34
+ summary,
35
+ params
36
+ } )
37
+ } )
38
+
22
39
app . use ( bodyParser . json ( ) )
23
40
app . use ( bodyParser . urlencoded ( { extended : true } ) )
24
41
app . use ( bodyParser . text ( ) )
Original file line number Diff line number Diff line change 19
19
"@buzuli/json" : " ^1.1.3" ,
20
20
"axios" : " ^0.18.0" ,
21
21
"body-parser" : " ^1.18.3" ,
22
- "express" : " ^4.16.3 " ,
22
+ "express" : " ^4.16.4 " ,
23
23
"log-a-log" : " ^6.0.0" ,
24
24
"ramda" : " ^0.25.0" ,
25
- "yargs" : " ^12.0.1 "
25
+ "yargs" : " ^12.0.2 "
26
26
},
27
27
"devDependencies" : {
28
- "nodemon" : " ^1.18.3 "
28
+ "nodemon" : " ^1.18.4 "
29
29
}
30
30
}
You can’t perform that action at this time.
0 commit comments