diff --git a/src/server/index.tsx b/src/server/index.tsx index 31ceb77..1457df5 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -22,12 +22,16 @@ app.get('/ggwave.js', () => startup(PORT) +const hasCerts = await Bun.file('./certs/cert.pem').exists() + export default { ...app.defaults, port: PORT, idleTimeout: 255, - tls: { - key: Bun.file('./certs/key.pem'), - cert: Bun.file('./certs/cert.pem'), - }, + ...(hasCerts && { + tls: { + key: Bun.file('./certs/key.pem'), + cert: Bun.file('./certs/cert.pem'), + }, + }), }