Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.

Commit 54711da

Browse files
author
Ryan Muller
committed
Initial commit
0 parents  commit 54711da

4 files changed

Lines changed: 47 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.*.sw*
2+
node_modules/
3+
*.log

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM node:4.4
2+
COPY . /app
3+
WORKDIR /app
4+
CMD npm start

index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var express = require('express')
2+
var app = express()
3+
4+
app.all('*', (req, res) => {
5+
res.json({
6+
path: req.path,
7+
headers: req.headers,
8+
method: req.method,
9+
body: req.body,
10+
cookies: req.cookies,
11+
fresh: req.fresh,
12+
hostname: req.hostname,
13+
ip: req.ip,
14+
ips: req.ips,
15+
protocol: req.protocol,
16+
query: req.query,
17+
subdomains: req.subdomains,
18+
xhr: req.xhr,
19+
})
20+
})
21+
22+
app.listen(process.env.PORT || 3000)

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@kennship/http-echo",
3+
"version": "0.0.1",
4+
"description": "JSON service for debugging a web setup",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "node index.js",
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"author": "Ryan Muller <ryan@kennship.com>",
11+
"license": "BSD-3-Clause",
12+
"engines": {
13+
"node": ">=4.4.1"
14+
},
15+
"dependencies": {
16+
"express": "^4.13.4"
17+
}
18+
}

0 commit comments

Comments
 (0)