mirror of
https://github.com/The-Art-of-Hacking/h4cker
synced 2024-11-25 12:20:18 +00:00
Create server.js
This commit is contained in:
parent
56d9bc9aef
commit
5c52f16bda
1 changed files with 14 additions and 0 deletions
14
docker-and-k8s-security/docker/server.js
Normal file
14
docker-and-k8s-security/docker/server.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
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');
|
||||
res.end('Hello from node.js!');
|
||||
});
|
||||
|
||||
server.listen(port, hostname, () => {
|
||||
console.log(`Server running at http://${hostname}:${port}/`);
|
||||
});
|
Loading…
Reference in a new issue