Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jiawei397/oak_cors
Forked from the nodejs package expressjs cors. Now it is just a simple and opinionated cors middleware for Deno oak.
https://github.com/jiawei397/oak_cors
cors deno oak typescript
Last synced: about 2 months ago
JSON representation
Forked from the nodejs package expressjs cors. Now it is just a simple and opinionated cors middleware for Deno oak.
- Host: GitHub
- URL: https://github.com/jiawei397/oak_cors
- Owner: jiawei397
- License: mit
- Created: 2021-10-25T09:42:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-06T07:29:26.000Z (over 2 years ago)
- Last Synced: 2024-11-17T14:12:08.280Z (3 months ago)
- Topics: cors, deno, oak, typescript
- Language: TypeScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oak_cors
[![Deno](https://github.com/jiawei397/oak_cors/actions/workflows/deno.yml/badge.svg)](https://github.com/jiawei397/oak_cors/actions/workflows/deno.yml)
Forked from the nodejs package
[expressjs cors](https://github.com/expressjs/cors/blob/master/lib/index.js).
Now it is just a simple and opinionated cors middleware for Deno
[oak](https://deno.land/x/oak).## Example
```typescript
import { CORS } from "https://deno.land/x/[email protected]/mod.ts";
import { Application } from "https://deno.land/x/oak/mod.ts";const app = new Application();
app.use(CORS());// other middleware
await app.listen(":80");
```If you use the default options, it will work as both `origin: true` and
`credentials: true`.