@@ -340,7 +341,7 @@ It's common for middleware to require additional customization or options from d
## Next steps
-Check out our pre-build middleware and examples:
+Check out our pre-built middleware and examples:
} href={'/docs/features/middleware/dependency-injection'}>
@@ -355,6 +356,9 @@ Check out our pre-build middleware and examples:
} href={'/docs/examples/track-failures-in-datadog'}>
Add tracing with Datadog under a few minutes.
+ } href={'/docs/examples/middleware/cloudflare-workers-environment-variables'}>
+ Access environment variables within Inngest functions.
+
diff --git a/pages/docs/learn/serving-inngest-functions.mdx b/pages/docs/learn/serving-inngest-functions.mdx
index 7100f84b2..fa4d87b59 100644
--- a/pages/docs/learn/serving-inngest-functions.mdx
+++ b/pages/docs/learn/serving-inngest-functions.mdx
@@ -1,4 +1,4 @@
-import { Callout, CodeGroup, VersionBadge, GuideSelector, GuideSection } from "shared/Docs/mdx";
+import { Callout, Tip, CodeGroup, VersionBadge, GuideSelector, GuideSection, Col, Row } from "shared/Docs/mdx";
export const description = `Serve the Inngest API as an HTTP endpoint in your application.`
export const hidePageSidebar = true;
@@ -32,13 +32,41 @@ serve({
});
```
-
- You will find the complete list of supported frameworks below.
-
-
-## Supported Platforms
-
-Below you will find a list of framework-specific bindings, as well as instructions on adding bindings to [custom platforms](#custom-frameworks)!
+## Supported frameworks and platforms
+
+
+
+
+* [Astro](#framework-astro)
+* [AWS Lambda](#framework-aws-lambda)
+* [Bun](#bun-serve)
+* [Cloudflare Pages](#framework-cloudflare-pages-functions)
+* [Cloudflare Workers](#framework-cloudflare-workers)
+* [DigitalOcean Functions](#framework-digital-ocean-functions)
+* [Express](#framework-express)
+
+
+* [Fastify](#framework-fastify)
+* [Fresh (Deno)](#framework-fresh-deno)
+* [Google Cloud Run Functions](#framework-google-cloud-run-functions)
+* [Firebase Cloud functions](#framework-firebase-cloud-functions)
+* [H3](#framework-h3)
+* [Hono](#framework-hono)
+* [Koa](#framework-koa)
+
+
+* [NestJS](#framework-nest-js)
+* [Next.js](#framework-next-js)
+* [Nitro](#framework-nitro)
+* [Nuxt](#framework-nuxt)
+* [Redwood](#framework-redwood)
+* [Remix](#framework-remix)
+* [SvelteKit](#framework-svelte-kit)
+
+
+
+
+You can also create a custom serve handler for any framework or platform not listed here - [read more here](#custom-frameworks).
Want us to add support for another framework? Open an issue on [GitHub](https://github.com/inngest/website) or tell us about it on our [Discord](/discord).
@@ -155,11 +183,17 @@ export default {
fetch: serve({
client: inngest,
functions: [fnA],
+ // We suggest explicitly defining the path to serve Inngest functions
+ servePath: "/api/inngest",
}),
};
```
+
+ To automatically pass environment variables defined with Wrangler to Inngest function handlers, use the [Cloudflare Workers bindings middleware](/docs/examples/middleware/cloudflare-workers-environment-variables).
+
+
When developing locally with Wrangler and the `--remote` flag, your code is
deployed and run remotely. To use this with a local Inngest Dev Server, you must
use a tool such as [ngrok](https://ngrok.com/) or
@@ -488,7 +522,7 @@ See the [github.com/unjs/h3](https://github.com/unjs/h3) repository for more inf
### Framework: Hono
-Add the following to `./src/index.ts`:
+Inngest supports the [Hono](https://hono.dev/) framework which is popularly deployed to Cloudflare Workers. Add the following to `./src/index.ts`:
```ts
@@ -511,6 +545,10 @@ export default app;
```
+
+ To automatically pass environment variables defined with Wrangler to Inngest function handlers, use the [Hono bindings middleware](/docs/examples/middleware/cloudflare-workers-environment-variables).
+
+
See the [Hono example](https://github.com/inngest/inngest-js/blob/main/examples/framework-hono) for more information.
### Framework: Koa
diff --git a/pages/docs/reference/middleware/examples.mdx b/pages/docs/reference/middleware/examples.mdx
index 32905608e..925dfe688 100644
--- a/pages/docs/reference/middleware/examples.mdx
+++ b/pages/docs/reference/middleware/examples.mdx
@@ -1,4 +1,5 @@
-import { Callout, CodeGroup, Properties, Property, Row, Col, VersionBadge } from "src/shared/Docs/mdx";
+import { Callout, CodeGroup, Properties, Property, Row, Col, VersionBadge, Card, CardGroup } from "src/shared/Docs/mdx";
+import { RiKeyLine } from "@remixicon/react"
# Example middleware
@@ -8,6 +9,7 @@ The following examples show how you might use middleware in some real-world scen
- [Common actions for every function](#common-actions-for-every-function)
- [Logging](#logging)
- [Prisma in function context](#prisma-in-function-context)
+- [Cloudflare Workers & Hono environment variables](/docs/examples/middleware/cloudflare-workers-environment-variables)
---
@@ -283,3 +285,10 @@ const prismaMiddleware = new InngestMiddleware({
Check out [Common actions for every function](/docs/reference/middleware/examples#common-actions-for-every-function) to see how this technique can be used to create steps for all of your unique logic.
+## Other examples
+
+
+ } href={'/docs/examples/middleware/cloudflare-workers-environment-variables'}>
+ Access environment variables within Inngest functions.
+
+
\ No newline at end of file
diff --git a/shared/Docs/navigationStructure.ts b/shared/Docs/navigationStructure.ts
index 94f1127eb..4425a0b7d 100644
--- a/shared/Docs/navigationStructure.ts
+++ b/shared/Docs/navigationStructure.ts
@@ -652,7 +652,7 @@ const sectionHome: (NavGroup | NavLink)[] = [
href: `/docs/features/middleware`,
},
{
- title: "Creating a middleware",
+ title: "Creating middleware",
href: `/docs/features/middleware/create`,
},
{
@@ -864,6 +864,16 @@ const sectionExamples: NavGroup[] = [
},
],
},
+ {
+ title: "Middleware",
+ defaultOpen: true,
+ links: [
+ {
+ title: "Cloudflare Workers & Hono environment variables",
+ href: `/docs/examples/middleware/cloudflare-workers-environment-variables`,
+ },
+ ],
+ },
];
export const isNavGroup = (