forked from editdata/app.editdata.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.js
34 lines (32 loc) · 881 Bytes
/
router.js
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
34
var sheetRouter = require('sheet-router')
var Index = require('../pages/index')
var About = require('../pages/about')
var Support = require('../pages/support')
var Editor = require('../pages/editor')
module.exports = Router
function Router (app) {
return sheetRouter(function (route, thunk) {
return [
thunk('/', function (o, props) {
return Index(props)
}),
thunk('/about', function (o, props) {
return About(props)
}),
thunk('/support', function (o, props) {
return Support(props)
}),
route('/edit', [
thunk('/', function (o, props) {
return Editor(props)
}),
thunk('/new', function (o, props) {
return Editor(props)
}),
thunk('/github/:owner/:repo/:branch', function (o, props) {
return Editor(props)
})
])
]
})
}