Add error handling to the frontend

This commit is contained in:
Jonathan Cremin 2016-10-23 23:04:32 +01:00
parent b5cb3e78ab
commit 0a9ea15b58
6 changed files with 77 additions and 18 deletions

3
app.js
View file

@ -15,6 +15,7 @@ import recent from './routes/recent';
import search from './routes/search';
import share from './routes/share';
import itunesProxy from './routes/itunes-proxy';
import errorHandler from './lib/error-handler';
const debug = debuglog('match.audio');
@ -22,6 +23,8 @@ process.env.VUE_ENV = 'server';
const app = koa();
app.use(errorHandler());
app.use(bodyparser());
app.use(cors());
app.use(compress({ flush: zlib.Z_SYNC_FLUSH }));