A simple Node.js API endpoint to print and inspect HTTP headers, including token headers.
- Prints all received HTTP headers to console
- Specifically identifies and highlights token-related headers (authorization, token, auth)
- Supports both GET and POST requests
- Returns headers in JSON format
npm installnpm startThe server will start on port 3000 (or the port specified in the PORT environment variable).
Accepts any HTTP method and prints all headers to the console and returns them in the response.
Example using curl:
# Simple GET request
curl http://localhost:3000/headers
# POST request with Authorization header
curl -X POST http://localhost:3000/headers \
-H "Authorization: Bearer your-token-here" \
-H "X-Custom-Token: custom-value" \
-H "Content-Type: application/json" \
-d '{"data": "test"}'Response format:
{
"message": "Headers received successfully",
"headers": {
"host": "localhost:3000",
"authorization": "Bearer your-token-here",
"x-custom-token": "custom-value",
...
},
"tokenHeaders": {
"authorization": "Bearer your-token-here",
"x-custom-token": "custom-value"
},
"timestamp": "2025-11-17T04:26:38.049Z"
}Health check endpoint.
curl http://localhost:3000/healthReturns API information and available endpoints.
curl http://localhost:3000/PORT- Server port (default: 3000)
ISC