-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use HTTP/2 #23
Comments
spdy-http2/node-spdy: SPDY server on Node.js HTTP2でexpressを動かす - non vorrei lavorare オレオレ証明書の作成についてメモ
コードの修正をする。 diff --git a/server/src/index.js b/server/src/index.js
index da7366b..007e66a 100644
--- a/server/src/index.js
+++ b/server/src/index.js
@@ -1,11 +1,21 @@
-import http from 'http';
+import { readFileSync } from 'fs';
+import spdy from 'spdy';
import { app } from './app';
import { insertSeeds } from './seeds';
import { sequelize } from './sequelize';
+const spdyOptions = {
+ // Private key
+ key: readFileSync(__dirname + '/../keys/spdy-key.pem'),
+ // Fullchain file or cert file (prefer the former)
+ cert: readFileSync(__dirname + '/../keys/spdy-cert.pem'),
+ ca: readFileSync(__dirname + '/../keys/spdy-ca.pem'),
+ passphrase: 'pass',
+};
+
async function main() {
- const server = http.createServer(app);
+ const server = spdy.createServer(spdyOptions, app);
// データベースの初期化をします
await sequelize.sync({ 試してみたが、エラーになる。 サーバーのログには以下が出ている。
関連するIssueがあった。Node16には対応してなさそう... |
herokuはhttp/2に対応していない。。? |
HTTP/2対応するなら別のPaaSにデプロイする必要がある。 |
Does not use HTTP/2 for all of its resources
https://web.dev/uses-http2/?utm_source=lighthouse&utm_medium=devtools
The text was updated successfully, but these errors were encountered: