5145c2d5e2
Convert `api-routes-cores` example to TypeScript to match Contribution docs. - Update CORS configuration to match the [middleware Next.js docs](https://nextjs.org/docs/api-routes/api-middlewares#connectexpress-middleware-support) - Allow POST requests as per instructions in `index.tsx`: "make a **POST** / GET / OPTIONS request to /api/cors" ## Documentation / Examples - [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)
21 lines
416 B
JSON
21 lines
416 B
JSON
{
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next",
|
|
"build": "next build",
|
|
"start": "next start"
|
|
},
|
|
"dependencies": {
|
|
"cors": "^2.8.5",
|
|
"next": "latest",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/cors": "^2.8.12",
|
|
"@types/node": "^18.0.1",
|
|
"@types/react": "^18.0.14",
|
|
"@types/react-dom": "^18.0.6",
|
|
"typescript": "^4.7.4"
|
|
}
|
|
}
|