Skip to content

Commit dddd177

Browse files
committed
added port
0 parents  commit dddd177

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

.gitignore

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

app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var http = require("http");
2+
var express = require("express");
3+
4+
var app = express();
5+
6+
app.use(function(req, res)
7+
{
8+
res.json({"Ip address":req.ip, "UserAgent":req.get("user-agent"), "language":req.acceptsLanguages()});
9+
})
10+
11+
http.createServer(app).listen(3020);

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "requestheader",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "app.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"express": "^4.15.3"
13+
}
14+
}

0 commit comments

Comments
 (0)