-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add an example for cloudflare-workers #27
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
feat: add an example for cloudflare-workers #27
Conversation
| }>() | ||
|
|
||
| app.use(async(c, next) => { | ||
| c.set('hono-context', 'hono-context') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to change the variable's name and value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to use the same names with the Pages example: https://github.com/yusukebe/hono-remix-adapter/pull/24/files#diff-1a16d957977e7aaf27b0228dd216f0d8e30696f730d89b6d0d03c1c45fc3babbR14
| const app = new Hono<{ | ||
| Bindings: { | ||
| MY_VAR: string | ||
| } | ||
| }, | ||
| Variables: { | ||
| 'MY_VAR_IN_VARIABLES': string | ||
| }, | ||
| }>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use Env imported from load-context.ts, but I didn't change it because I wasn't sure if I was allowed to.
| const app = new Hono<{ | |
| Bindings: { | |
| MY_VAR: string | |
| } | |
| }, | |
| Variables: { | |
| 'MY_VAR_IN_VARIABLES': string | |
| }, | |
| }>() | |
| + import type { Env } from '../load-context' | |
| + const app = new Hono<Env>() |
If I change it, I also need to update cloudflare-pages.
|
@ogadra Thanks! |
Related #24
Hello.
I added an example of #24 using Cloudflare Workers.
#24 (comment)
Screenshot