Re-use route function

This commit is contained in:
Michael Jackson 2018-12-17 13:58:59 -08:00
parent 19b2e5574b
commit 995a977e59
1 changed files with 79 additions and 81 deletions

View File

@ -9,8 +9,7 @@ function route(setup) {
}
function createRouter() {
const app = express.Router();
return route(app => {
app.get('/', require('./actions/serveRootPage'));
app.use(cors());
@ -98,8 +97,7 @@ function createRouter() {
require('./middleware/findFile'),
require('./actions/serveFile')
);
return app;
});
}
module.exports = createRouter;