Hono with Node

How to get the .env variables from the context in hono with the node tamplate?
2 Replies
Nico
Nico6mo ago
You can use the dotenv package inside node, you don't have to access them from inside the context If you want it in context you would still have to use dotenv to load them in but you can do the following
serve({
fetch: app.fetch(req, { MY_SECRET: process.env.MY_SECRET }),
port: 8787,
})
serve({
fetch: app.fetch(req, { MY_SECRET: process.env.MY_SECRET }),
port: 8787,
})
I am sure there is a way you could automate that. They would be available in c.env
Erik Giovani
Erik Giovani6mo ago
Thanks Nico
Want results from more Discord servers?
Add your server