Skip to content

Commit

Permalink
Update Convex example to convex 0.1.9 (vercel#40162)
Browse files Browse the repository at this point in the history
## Documentation / Examples

Update Convex to 0.1.9, now including specific deploy instructions for Vercel.

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
  • Loading branch information
thomasballinger authored and atilafassina committed Sep 5, 2022
1 parent 03813e1 commit 4febc53
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions examples/convex/README.md
Expand Up @@ -13,11 +13,11 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:

```bash
npx create-next-app --example with-convex with-convex-app
npx create-next-app --example convex convex-app
# or
yarn create next-app --example with-convex with-convex-app
yarn create next-app --example convex convex-app
# or
pnpm create next-app --example with-convex with-convex-app
pnpm create next-app --example convex convex-app
```

Log in to Convex,
Expand All @@ -32,16 +32,16 @@ initialize a new Convex project,
npx convex init
```

and push the Convex functions for this project.
and then run the following two commands in two different terminals:

```bash
npx convex push
npx convex dev
```

Now you can run your code locally with a Convex backend with

```bash
npm run dev
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
Once everything is working, commit your code and deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

Use `npx convex deploy && npm run build` as the build command and set the `CONVEX_DEPLOY_KEY` environmental variable in Vercel ([Documentation](https://docs.convex.dev/getting-started/deployment/hosting/vercel)).
2 changes: 1 addition & 1 deletion examples/convex/convex/_generated/dataModel.ts
Expand Up @@ -4,7 +4,7 @@
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@0.1.8.
* Generated by convex@0.1.9.
* To regenerate, run `npx convex codegen`.
* @module
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/convex/convex/_generated/react.ts
Expand Up @@ -4,7 +4,7 @@
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@0.1.8.
* Generated by convex@0.1.9.
* To regenerate, run `npx convex codegen`.
* @module
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/convex/convex/_generated/server.ts
Expand Up @@ -4,7 +4,7 @@
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* Generated by convex@0.1.8.
* Generated by convex@0.1.9.
* To regenerate, run `npx convex codegen`.
* @module
*/
Expand Down
4 changes: 2 additions & 2 deletions examples/convex/pages/_app.tsx
Expand Up @@ -2,8 +2,8 @@ import '../styles/globals.css'
import type { AppProps } from 'next/app'

import { ConvexProvider, ConvexReactClient } from 'convex/react'
import convexConfig from '../convex.json'
const convex = new ConvexReactClient(convexConfig.origin)
import clientConfig from '../convex/_generated/clientConfig'
const convex = new ConvexReactClient(clientConfig)

function MyApp({ Component, pageProps }: AppProps) {
return (
Expand Down

0 comments on commit 4febc53

Please sign in to comment.