From 177bdbd9a54283025af78edaa77f73a850e0236b Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sun, 12 Sep 2021 00:07:09 +0430 Subject: http2 WIP --- server.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index 231f70b..0c245a3 100755 --- a/server.js +++ b/server.js @@ -19,7 +19,7 @@ const mit = require("markdown-it")({ html: true }) auto: true, code: true, }); -const https = require("https"); +const spdy = require("spdy"); const app = express(); app.use(express.static(path.join(__dirname, "css"))); @@ -94,9 +94,12 @@ app.use((err, req, res) => { return res.status(500).send({ error: err }); }); -https.createServer({ - key: fs.readFileSync("/certs/privkey1.pem","utf-8"), - cert: fs.readFileSync("/certs/fullchain1.pem","utf-8") -},app).listen(9000); - -// app.listen(9000); +spdy + .createServer( + { + key: fs.readFileSync("/certs/privkey1.pem", "utf-8"), + cert: fs.readFileSync("/certs/fullchain1.pem", "utf-8"), + }, + app + ) + .listen(9000); -- cgit v1.2.3