This is a simple node app that you can use to print out any incoming web requests. Just run
npm install
PORT=8080 npm run server
and then you can send any requests with any path to localhost:8080
.
node_modules/ |
express = require 'express' | |
bodyParser = require 'body-parser' | |
http = require 'http' | |
port = process.env.PORT || 8000 | |
app = express() | |
app.use bodyParser.json() | |
app.use bodyParser.urlencoded(extended: true) | |
app.all '*', (req, res) -> | |
console.log "Request", req.path | |
console.log req.body | |
res.status(204).send('') | |
server = http.createServer(app) | |
server.listen(port) | |
console.log "Started echo server on port #{port}" | |
console.log "Send any requests to any path under http://localhost:#{port}/ and I'll echo the body." |
{ | |
"name": "echo_server", | |
"version": "1.0.0", | |
"description": "Captures webrequests and prints out the body.", | |
"main": "app.coffee", | |
"dependencies": { | |
"body-parser": "^1.13.2", | |
"coffee-script": "^1.9.3", | |
"express": "^4.13.1", | |
"qs": "^4.0.0" | |
}, | |
"devDependencies": {}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"server": "coffee echo_server.coffee" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "git@gist.github.com:/4117cbbd8bf415c9a6bd.git" | |
}, | |
"author": "Otto Vehviläinen <vehvis@flowdock.com>", | |
"license": "ISC" | |
} |