Skip to content

Instantly share code, notes, and snippets.

@victory-sokolov
Created May 11, 2024 17:25
Show Gist options
  • Save victory-sokolov/58a52628088e0b1c4cf67e7416c3d943 to your computer and use it in GitHub Desktop.
Save victory-sokolov/58a52628088e0b1c4cf67e7416c3d943 to your computer and use it in GitHub Desktop.
Express server with Http2 support
const express = require('express');
const spdy = require('spdy');
const PORT = 8000;
const app = express();
app.get('/', (_, res) => {
res.send('hello world');
});
const server = spdy.createServer({}, app);
server.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
console.log('SSL enabled');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment