Skip to content

Instantly share code, notes, and snippets.

@mcollina
Created April 11, 2018 21:29
Show Gist options
  • Save mcollina/4a00a3a0c926b1b8a0e0ec460156b0e2 to your computer and use it in GitHub Desktop.
Save mcollina/4a00a3a0c926b1b8a0e0ec460156b0e2 to your computer and use it in GitHub Desktop.
const http2 = require('http2');
const options = {
key: getKeySomehow(),
cert: getCertSomehow()
};
// https is necessary otherwise browsers will not
// be able to connect
const server = http2.createSecureServer(options, (req, res) => {
res.end('Hello World!');
});
server.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment