2018-06-22 22:32:24 +02:00
|
|
|
const assets = require('../../common/assets');
|
|
|
|
const routes = require('../routes');
|
|
|
|
const pages = require('../routes/pages');
|
|
|
|
const tests = require('../../test/frontend/routes');
|
2019-08-06 23:12:22 +02:00
|
|
|
const expressWs = require('@dannycoates/express-ws');
|
2018-06-22 22:32:24 +02:00
|
|
|
|
|
|
|
module.exports = function(app, devServer) {
|
|
|
|
assets.setMiddleware(devServer.middleware);
|
|
|
|
expressWs(app, null, { perMessageDeflate: false });
|
|
|
|
routes(app);
|
2019-05-03 18:25:12 +02:00
|
|
|
app.ws('/api/ws', require('../routes/ws'));
|
2018-06-22 22:32:24 +02:00
|
|
|
tests(app);
|
|
|
|
// webpack-dev-server routes haven't been added yet
|
|
|
|
// so wait for next tick to add 404 handler
|
|
|
|
process.nextTick(() => app.use(pages.notfound));
|
|
|
|
};
|