Created
October 21, 2021 13:29
-
-
Save peterjgrainger/9315d3c52f3e1d759736fe50a1d12873 to your computer and use it in GitHub Desktop.
Headers
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
var http = require('http'); | |
//create a server object: | |
http.createServer(function (req, res) { | |
res.write(JSON.stringify(req.headers)); //write a response to the client | |
res.end(); //end the response | |
}).listen(3000); //the server object listens on port 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment