A tiny local httpbin-like utility.
Requests are logged to the console. Colored output is enabled when the terminal supports it.
npx simple-http-bin --port 8081npm install -g simple-http-binnpm install simple-http-bin| flag | description | example(s) |
|---|---|---|
--port <n>, -p <n> |
Set the port to listen on. | simple-http-bin --port 8080, simple-http-bin -p 8080 |
<n> |
Pass the port as the first non-flag argument. | simple-http-bin 8080 |
PORT=<n> |
Set the port via environment variable. | PORT=8080 simple-http-bin |
HOST=<host> |
Bind to a different host. | HOST=0.0.0.0 simple-http-bin |
-v, -vv, -vvv, --verbose |
Increase request logging detail. Repeat -v for more verbosity. |
simple-http-bin -v, simple-http-bin -vv, simple-http-bin --verbose |
GET /show help textGET /headersecho request headers as JSONANY /anythingecho method, path, query, headers, and bodyANY /status/:codereturn the given HTTP status code
curl http://127.0.0.1:51234/headers
curl -X POST http://127.0.0.1:51234/anything -d "hello"
curl -i http://127.0.0.1:51234/status/418