# Example application using [`joi`](https://github.com/sideway/joi) and [`next-joi`](https://github.com/codecoolture/next-joi)

This example shows how to validate Next.js API routes by using the `joi` and `next-joi` packages. It contains samples for both API routes using a [Connect middleware](https://github.com/hoangvvo/next-connect) (see `/api/people`) and regular API routes (see `/api/cars`).

## Deploy your own

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-joi&project-name=with-joi&repository-name=with-joi)

## How to use

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-joi with-joi-app
```

```bash
yarn create next-app --example with-joi with-joi-app
```

```bash
pnpm create next-app --example with-joi with-joi-app
```

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)).
