koa2-cors-errordeprecated

Allow 4xx or 5xx statuses for koa2 cross-domain requests.

Usage no npm install needed!

<script type="module">
  import koa2CorsError from 'https://cdn.skypack.dev/koa2-cors-error';
</script>

README

koa-cors-error

Module has fixed the bug when the system didn't send the 4xx or 5xx statuses through cross-domain requests. koa onerror method have been completely replaced.

Installation

$ npm install koa-cors-error

Use

var corsError = require('koa-cors-error');

app.use(cors());
app.use(corsError());

app.use(function(ctx, next) {
    ctx.throw(400);
});