https://github.com/spellcraftai/nextjs-cors-demo
A demo of CORS in Next.js Edge runtime.
https://github.com/spellcraftai/nextjs-cors-demo
Last synced: 10 months ago
JSON representation
A demo of CORS in Next.js Edge runtime.
- Host: GitHub
- URL: https://github.com/spellcraftai/nextjs-cors-demo
- Owner: SpellcraftAI
- License: mit
- Created: 2023-07-28T09:35:14.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-28T09:59:40.000Z (almost 3 years ago)
- Last Synced: 2025-03-19T21:54:00.513Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://nextjs-edge-cors.vercel.app/api/cors
- Size: 72.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Next.js Edge Runtime: CORS Demo
Demos [`nextjs-edge-cors`](https://github.com/SpellcraftAI/nextjs-edge-cors).
See docs for more info.
```ts
// src/middleware.ts
import { CorsMiddleware } from "nextjs-edge-cors";
export const middleware = CorsMiddleware({
origin: "*"
})
export const config = {
matcher: ["/api/cors/:path*"]
};
```