Last active
August 17, 2022 20:24
-
-
Save zbicin/c171392d0328ccf67cc9d23a47338ba7 to your computer and use it in GitHub Desktop.
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
const http = require('http'); | |
const requestListener = function (req, res) { | |
res.writeHead(200); | |
res.end(JSON.stringify({ headers: req.headers, cookies: req.cookies })); | |
} | |
const server = http.createServer(requestListener); | |
const port = process.env.ECHO_SERVER_PORT || 8080; | |
server.listen(port, '0.0.0.0', () => { | |
console.log(`Echo server listening on port ${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment