Update index.mjs
Browse files
index.mjs
CHANGED
|
@@ -1 +1,14 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import http from 'http';
|
| 2 |
+
|
| 3 |
+
const hostname = '0.0.0.0';
|
| 4 |
+
const port = 7860;
|
| 5 |
+
|
| 6 |
+
const server = http.createServer((req, res) => {
|
| 7 |
+
res.statusCode = 200;
|
| 8 |
+
res.setHeader('Content-Type', 'text/plain');
|
| 9 |
+
res.end('<html>Hello, World!\n</html>');
|
| 10 |
+
});
|
| 11 |
+
|
| 12 |
+
server.listen(port, hostname, () => {
|
| 13 |
+
console.log(`Server running at http://${hostname}:${port}/`);
|
| 14 |
+
});
|