Created
May 19, 2020 23:32
-
-
Save nathanleclaire/7806eb6421259f34985dcb4ac50320d9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'); | |
var beeline = require('honeycomb-beeline')({ | |
writeKey: "key", | |
dataset: "nathanleclaire.nodejsbeelinetest", | |
serviceName: "frameworks-are-bloated-http-directly-rules" | |
}); | |
//create a server object: | |
http.createServer(function (req, res) { | |
let trace = beeline.startTrace(); | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.write('Hello World!'); //write a response to the client | |
res.end(); //end the response | |
beeline.finishTrace(trace); | |
}).listen(8080); //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