aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/index.js4
-rw-r--r--server/controllers/views.js27
2 files changed, 1 insertions, 30 deletions
diff --git a/server/controllers/index.js b/server/controllers/index.js
index 858f493da..7b0288dbb 100644
--- a/server/controllers/index.js
+++ b/server/controllers/index.js
@@ -3,9 +3,7 @@
3var constants = require('../initializers/constants') 3var constants = require('../initializers/constants')
4 4
5var apiController = require('./api/' + constants.API_VERSION) 5var apiController = require('./api/' + constants.API_VERSION)
6var viewsController = require('./views')
7 6
8module.exports = { 7module.exports = {
9 api: apiController, 8 api: apiController
10 views: viewsController
11} 9}
diff --git a/server/controllers/views.js b/server/controllers/views.js
deleted file mode 100644
index aa9718079..000000000
--- a/server/controllers/views.js
+++ /dev/null
@@ -1,27 +0,0 @@
1'use strict'
2
3var express = require('express')
4
5var cacheMiddleware = require('../middlewares').cache
6
7var router = express.Router()
8
9router.get(/^\/(index)?$/, cacheMiddleware.cache(), getIndex)
10router.get('/partials/:directory/:name', cacheMiddleware.cache(), getPartial)
11
12// ---------------------------------------------------------------------------
13
14module.exports = router
15
16// ---------------------------------------------------------------------------
17
18function getIndex (req, res) {
19 res.render('index')
20}
21
22function getPartial (req, res) {
23 var directory = req.params.directory
24 var name = req.params.name
25
26 res.render('partials/' + directory + '/' + name)
27}