-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
28 lines (20 loc) · 686 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const http = require('http');
const hostname = '0.0.0.0';
const port = 8080;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
const ordered = Object.keys(process.env).sort().reduce(
(obj, key) => {
obj[key] = process.env[key];
return obj;
},
{}
);
var myArgs = process.argv;
var newDate = new Date();
res.end('Environment Variables\n\n' + JSON.stringify(ordered, null, 4) + '\n\nArguments:\n\n' + myArgs + '\n\nWelcome to Control Plane!\n\n\nThe time is: ' + newDate.toUTCString());
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});