Skip to content

Commit 53ab31f

Browse files
committed
Switched from spdy (deprecated) to the newborn node-core's http2
1 parent fb75a97 commit 53ab31f

3 files changed

Lines changed: 46 additions & 182 deletions

File tree

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
const path = require("path")
44
const fs = require("fs")
55
const http = require("http")
6-
// spdy will be deprecated soon, waiting for HTTP/2 support on https module.
7-
const https = require("spdy")
6+
const https = require("http2")
87
const express = require("express")
98
const compression = require("compression")
109

@@ -15,7 +14,7 @@ const certOptions = {
1514
}
1615

1716
const port = process.env.PORT ||
18-
/* istanbul ignore next: impossible to test */ 443
17+
/* istanbul ignore next: impossible to test */ 443
1918

2019
// run express
2120
const app = express()
@@ -32,7 +31,7 @@ if (port === 443 || process.env.HTTP_PORT)
3231
res.writeHead(301, { Location: "https://" + req.headers["host"] + req.url })
3332
res.end()
3433
}).listen(process.env.HTTP_PORT ||
35-
/* istanbul ignore next: impossible to test */ 80)
34+
/* istanbul ignore next: impossible to test */ 80)
3635

3736
// serve static files, if launched as: "node index.js <static-path>"
3837
/* istanbul ignore else: useless to test */

0 commit comments

Comments
 (0)