Spaces:
Sleeping
Sleeping
Commit
·
30b2c8b
1
Parent(s):
fb73eec
Create app.js
Browse files
app.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const http = require('http');
|
| 2 |
+
|
| 3 |
+
const hostname = process.env.HOST || '0.0.0.0';
|
| 4 |
+
const port = process.env.PORT || 7860;
|
| 5 |
+
|
| 6 |
+
const server = http.createServer((req, res) => {
|
| 7 |
+
res.statusCode = 200;
|
| 8 |
+
res.setHeader('Content-Type', 'text/plain');
|
| 9 |
+
res.end('Hello World');
|
| 10 |
+
});
|
| 11 |
+
|
| 12 |
+
server.listen(port, hostname, () => {
|
| 13 |
+
console.log(`Server running at http://${hostname}:${port}/`);
|
| 14 |
+
});
|