-
Notifications
You must be signed in to change notification settings - Fork 51
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
Unified access to environment variables? #140
Comments
Hi @KGZM We should use import { env } from 'hono/adapter' That, the code in the search results is not good. Many of these were created when there was no |
@yusukebe should |
@yusukebe How do I use |
Does this not work? import { env } from 'hono/adapter'
app.openapi(route, (c) => {
console.log(env(c)) // <===
// ...
}) |
If
c.env
is intended to be for uniform environment access then we need some way to provide values toc.env
when using the node-server.I read issue #72, but the discussion there seems to miss the point. The problem isn't reading the environment, it's providing it.
Take a look at this search for c.env on the middleware repo.
The decision tree "If on cloudflare workers use
c.env
, else if on NodeJS useprocess.env
" doesn't seem to work with shared middleware.How is shared middleware supposed to work if
c.env
andprocess.env
remain entirely separate?The text was updated successfully, but these errors were encountered: