Merge branch 'dev-1.3.0' of gitlab.corp.qunar.com:mfe/yapi into dev-1.3.0

This commit is contained in:
gaoxiaolin.gao 2017-12-20 11:38:08 +08:00
commit 9d5167c45c

View File

@ -20,18 +20,16 @@ let indexFile = process.argv[2] === 'dev' ? 'dev.html' : 'index.html';
const app = websockify(new Koa());
app.proxy = true;
yapi.app = app;
app.use(bodyParser({multipart: true}));
app.use(mockServer);
app.use(router.routes());
app.use(router.allowedMethods());
websocket(app);
app.use( async (ctx, next) => {
if( /^\/(?!api)[a-zA-Z0-9\/\-_]*$/.test(ctx.path) ){
ctx.path = "/"