Replies: 2 comments
-
It's in bun's documentation https://bun.sh/guides/http/tls import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Bun!'))
export default {
port: 3000,
fetch: app.fetch,
tls: {
cert: Bun.file("cert.pem"),
key: Bun.file("key.pem"),
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
If anybody else faced this issue of the Start Line being false, it's the encoding, this worked for me: import { Hono } from 'hono';
import fs from 'fs';
const app = new Hono()
app.get('/', (c) => {
return c.text('Hello Hono!')
})
const certPath = Bun.env.CERT;
const keyPath = Bun.env.KEY;
const cert = fs.readFileSync(certPath, 'utf8');
const key = fs.readFileSync(keyPath, 'utf8');
console.log(`Starting server with CERT: ${certPath} and ${keyPath}`);
export default {
host: Bun.env.HOST || 'localhost',
port: Bun.env.PORT || 3000,
fetch: app.fetch,
tls: {
cert,
key,
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On node-js adapter documentation page we have an example on how to add certificates to the server.
I can't find a way to do the same with Bun, where can I find any documentation for it?
Beta Was this translation helpful? Give feedback.
All reactions