Created
October 17, 2021 19:33
-
-
Save yoyu777/3fce7e75e809089965f184994dab201d to your computer and use it in GitHub Desktop.
http_server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
//it is necessary to start a web server, | |
//so App Engine is happy | |
*/ | |
const http = require('http'); | |
const hostname = '0.0.0.0'; | |
const port = process.env.PORT; | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('The server has started'); | |
}); | |
server.listen(port, hostname, () => { | |
console.log(`Server running at http://${hostname}:${port}/`); | |
}); | |
/* | |
End of web server | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment