CORS
This commit is contained in:
@ -7,6 +7,7 @@ const serveIndex = require('koa-serve-index')
|
||||
const morgan = require('koa-morgan')
|
||||
const compress = require('koa-compress')
|
||||
const streamLogStats = require('stream-log-stats')
|
||||
const cors = require('kcors')
|
||||
|
||||
/**
|
||||
* @module local-web-server
|
||||
@ -31,7 +32,8 @@ function getApp (options) {
|
||||
|
||||
const app = new Koa()
|
||||
|
||||
// CORS
|
||||
/* CORS: allow from any origin */
|
||||
app.use(convert(cors()))
|
||||
|
||||
if (options.mime) {
|
||||
app.use((ctx, next) => {
|
||||
|
Reference in New Issue
Block a user