Skip to content

Commit

Permalink
Update vercel deployment docs to the latest syntax (#553)
Browse files Browse the repository at this point in the history
Co-authored-by: Darwin D Wu <[email protected]>
  • Loading branch information
darwin67 and darwin67 authored Nov 1, 2023
1 parent 42393cc commit 245ae8e
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions pages/docs/deploy/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,48 @@ Inngest will call your functions securely via HTTP request on-demand, whether tr

After you've written your functions using [Next.js](/docs/sdk/serve?ref=docs-deploy-vercel#framework-next-js) or Vercel's [Express-like](/docs/sdk/serve?ref=docs-deploy-vercel#framework-express) functions within your project, you need to serve them via the `serve` handler. Using the `serve` handler, create a Vercel/Next.js function at the `/api/inngest` endpoint. Here's an example in a Next.js app:

```js
// ./pages/api/inngest.js
## Choose the Next.js App Router or Pages Router:

<GuideSelector
options={[
{ key: "nextappdir", title: "Next.js - App Router" },
{ key: "nextpages", title: "Next.js - Pages Router" }
]}
>

<GuideSection show="nextpages">
```ts
import { serve } from "inngest/next";
import firstFunction from "../../inngest/first";
import anotherFunction from "../../inngest/another";
import { client } from "../../inngest/client";
import { firstFunction, anotherFunction } from "../../inngest/functions";

export default serve({
client: client,
functions: [
firstFunction,
anotherFunction
]
});
```
</GuideSection>

export default serve("Your app's name", [ firstFunction, anotherFunction ]);
<GuideSection show="nextappdir">
```ts
import { serve } from "inngest/next";
import { client } from "../../inngest/client";
import { firstFunction, anotherFunction } from "../../inngest/functions";

export const { GET, POST, PUT } = serve({
client: client,
functions: [
firstFunction,
anotherFunction
]
});
```
</GuideSection>

</GuideSelector>

## Deploying to Vercel

Expand Down

1 comment on commit 245ae8e

@vercel
Copy link

@vercel vercel bot commented on 245ae8e Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

website – ./

www.inngest.com
inngest.vercel.app
website-inngest.vercel.app
website-git-main-inngest.vercel.app

Please sign in to comment.