Spaces:
Running
Running
chaowenguo
commited on
Create server.mjs
Browse files- server.mjs +11 -0
server.mjs
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import http from 'http'
|
2 |
+
const server = http.createServer((req, res) =>
|
3 |
+
{
|
4 |
+
res.statusCode = 200
|
5 |
+
res.setHeader('Content-Type', 'text/plain')
|
6 |
+
res.end('Hello World')
|
7 |
+
})
|
8 |
+
server.listen(7860)
|
9 |
+
|
10 |
+
import process from 'process'
|
11 |
+
process.on('uncaughtException', _ => _)
|