Oak Middleware Validator
Oak middleware for parameter and body validator loosely ported from express cors
Usage
-
As a router middleware
import { corsMiddleware, CORSMiddlewareOptions } from "https://raw.githubusercontent.com/halvardssm/oak-middleware-cors/master/mod.ts" import { RouterMiddleware } from "https://deno.land/x/oak/mod.ts"; const router = new Router(); const app = new Application(); const options: CORSMiddlewareOptions ={ } router.get("/bar", corsMiddleware(options),...) app.use(router.routes()); await app.listen(appOptions);
-
As a middleware
import { corsMiddleware, CORSMiddlewareOptions } from "https://raw.githubusercontent.com/halvardssm/oak-middleware-cors/master/mod.ts" import { RouterMiddleware } from "https://deno.land/x/oak/mod.ts"; const router = new Router(); const app = new Application(); const options: CORSMiddlewareOptions ={ } router.get("/bar", ,...) app.use(corsMiddleware(options), router.routes()); await app.listen(appOptions);
Options
Contributing
All contributions are welcome, make sure to read the contributing guidelines.