Skip to content

Instantly share code, notes, and snippets.

@nathanleclaire
Created May 19, 2020 23:32
Show Gist options
  • Save nathanleclaire/7806eb6421259f34985dcb4ac50320d9 to your computer and use it in GitHub Desktop.
Save nathanleclaire/7806eb6421259f34985dcb4ac50320d9 to your computer and use it in GitHub Desktop.
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