0.1.4 • Published 7 years ago
express-downstream v0.1.4
Express Downstream
A simple server which prints out information about the request including the path, method, headers and environment.
It is often used as a Docker container when setting up proxy configurations.
npm install
PATH_404=/404 PATH_500=/500 SCRIPT_NAME="" NAME='Hello!' PORT=8000 DEBUG=express-downstream node bin/express-downstream.jsWith this setup, paths under /404 always return 404, paths under /500 return 500. Other paths return 200.
You can configure the following variables:
PORT- port to bind to, default 80NAME- the heading of the page, defaultExpress DownstreamSCRIPT_NAMEthe path at which a 200 page should be returned, default''PATH_404the path at which express should always return a 404 page for any sub-path, if not specified, no 404 handler will be usedPATH_500the path at which express should always return a 500 page for any sub-path, if not specified, no 500 handler will be usedDEBUG- can beexpress-downstream,express-downstream:debugfor full debugging,express-downstreamfor lkey messages, or empty for no debugging
Changelog
0.1.4 2019-01-02
- Show the value of
NAMEfor each request (as well as the existing path and status) and show it in theX-Nameresponse header
0.1.3 2019-01-02
- Make the 404 and 500 paths configurable too
- Handle
SIGTERM - Changed default port to 80
0.1.2 2018-12-30
- Added support for the
SCRIPT_NAMEenvironment variable - Made paths under
/404return a 404 status code, and paths under/500return a 500 status
0.1.1 2018-12-15
- Added a
NAMEenvironment variable defaulting toExpress Downstream
0.1.0
- Initial release