diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-03-07 14:48:46 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-03-07 14:48:46 +0100 |
commit | 6f4e252246c715a1dafc1e236c8074b08cdd12a3 (patch) | |
tree | afa187e6b1c192e315156499f01f1d7e040977e0 /server | |
parent | b9a3e09ad5a7673f64556d1dba122ed4c4fac980 (diff) | |
download | PeerTube-6f4e252246c715a1dafc1e236c8074b08cdd12a3.tar.gz PeerTube-6f4e252246c715a1dafc1e236c8074b08cdd12a3.tar.zst PeerTube-6f4e252246c715a1dafc1e236c8074b08cdd12a3.zip |
Prepare Angular routes
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/index.js | 4 | ||||
-rw-r--r-- | server/controllers/views.js | 27 | ||||
-rw-r--r-- | server/lib/videos.js | 1 |
3 files changed, 2 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 @@ | |||
3 | var constants = require('../initializers/constants') | 3 | var constants = require('../initializers/constants') |
4 | 4 | ||
5 | var apiController = require('./api/' + constants.API_VERSION) | 5 | var apiController = require('./api/' + constants.API_VERSION) |
6 | var viewsController = require('./views') | ||
7 | 6 | ||
8 | module.exports = { | 7 | module.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 | |||
3 | var express = require('express') | ||
4 | |||
5 | var cacheMiddleware = require('../middlewares').cache | ||
6 | |||
7 | var router = express.Router() | ||
8 | |||
9 | router.get(/^\/(index)?$/, cacheMiddleware.cache(), getIndex) | ||
10 | router.get('/partials/:directory/:name', cacheMiddleware.cache(), getPartial) | ||
11 | |||
12 | // --------------------------------------------------------------------------- | ||
13 | |||
14 | module.exports = router | ||
15 | |||
16 | // --------------------------------------------------------------------------- | ||
17 | |||
18 | function getIndex (req, res) { | ||
19 | res.render('index') | ||
20 | } | ||
21 | |||
22 | function getPartial (req, res) { | ||
23 | var directory = req.params.directory | ||
24 | var name = req.params.name | ||
25 | |||
26 | res.render('partials/' + directory + '/' + name) | ||
27 | } | ||
diff --git a/server/lib/videos.js b/server/lib/videos.js index 2d7d9500d..1e0a83b8b 100644 --- a/server/lib/videos.js +++ b/server/lib/videos.js | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | var async = require('async') | 3 | var async = require('async') |
4 | var config = require('config') | 4 | var config = require('config') |
5 | // TODO | ||
5 | var path = require('path') | 6 | var path = require('path') |
6 | var webtorrent = require('../lib/webtorrent') | 7 | var webtorrent = require('../lib/webtorrent') |
7 | 8 | ||