diff options
Diffstat (limited to 'routes/index.js')
-rw-r--r-- | routes/index.js | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/routes/index.js b/routes/index.js index 690913a84..ecca80721 100644 --- a/routes/index.js +++ b/routes/index.js | |||
@@ -1,24 +1,10 @@ | |||
1 | ;(function () { | 1 | ;(function () { |
2 | 'use strict' | 2 | 'use strict' |
3 | 3 | ||
4 | function getPartial (req, res) { | 4 | var routes = { |
5 | var directory = req.params.directory | 5 | api: require('./api/' + global.API_VERSION), |
6 | var name = req.params.name | 6 | views: require('./views') |
7 | |||
8 | res.render('partials/' + directory + '/' + name) | ||
9 | } | ||
10 | |||
11 | function getIndex (req, res) { | ||
12 | res.render('index') | ||
13 | } | 7 | } |
14 | 8 | ||
15 | var express = require('express') | 9 | module.exports = routes |
16 | var middleware = require('../middlewares') | ||
17 | |||
18 | var router = express.Router() | ||
19 | |||
20 | router.get('/partials/:directory/:name', middleware.cache(), getPartial) | ||
21 | router.get(/^\/(index)?$/, middleware.cache(), getIndex) | ||
22 | |||
23 | module.exports = router | ||
24 | })() | 10 | })() |