drop.chapril.org-firefoxsend/server/bin/test.js
Danny Coates c157e4d31c
created server/bin/ for server entrypoints
- added server/bin/test.js for the frontend test runner
2018-06-22 13:34:34 -07:00

19 lines
690 B
JavaScript

const assets = require('../../common/assets');
const locales = require('../../common/locales');
const routes = require('../routes');
const pages = require('../routes/pages');
const tests = require('../../test/frontend/routes');
const expressWs = require('express-ws');
module.exports = function(app, devServer) {
assets.setMiddleware(devServer.middleware);
locales.setMiddleware(devServer.middleware);
expressWs(app, null, { perMessageDeflate: false });
app.ws('/api/ws', require('../routes/ws'));
routes(app);
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));
};