Created
May 11, 2024 17:25
-
-
Save victory-sokolov/58a52628088e0b1c4cf67e7416c3d943 to your computer and use it in GitHub Desktop.
Express server with Http2 support
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
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