-
Notifications
You must be signed in to change notification settings - Fork 182
Expand file tree
/
Copy pathroutes.js
More file actions
33 lines (31 loc) · 750 Bytes
/
routes.js
File metadata and controls
33 lines (31 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const _ = require('lodash');
module.exports = {
// these will be applied to every page in the site.
middleware: [
"./middleware/RequestToPort",
],
// this maps URLs to modules that export a Page class.
routes: _.assign({
Index: {
path: ["/", "/foo", "/bar"], // Test for array support.
page: "./pages/index",
},
DataDelay: {
path: ["/data/delay"],
page: "./pages/data/delay",
},
CssEcho: {
path: ["/data/echo-css"],
page: "./pages/data/EchoCssPage",
},
DataError: {
path: ["/data/error"],
page: "./pages/data/error",
},
}, _.reduce(require('./entrypoints'), (obj, val, key) => {
if (!val.path) val.path = [val.entry];
val.page = `./pages${val.entry}`;
obj[key] = val;
return obj;
}, {})),
}