diff options
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,6 +1,9 @@ | |||
1 | ;(function () { | 1 | ;(function () { |
2 | 'use strict' | 2 | 'use strict' |
3 | 3 | ||
4 | // ----------- Constantes ----------- | ||
5 | global.API_VERSION = 'v1' | ||
6 | |||
4 | // ----------- Node modules ----------- | 7 | // ----------- Node modules ----------- |
5 | var express = require('express') | 8 | var express = require('express') |
6 | var path = require('path') | 9 | var path = require('path') |
@@ -28,7 +31,7 @@ | |||
28 | var config = require('config') | 31 | var config = require('config') |
29 | var logger = require('./src/logger') | 32 | var logger = require('./src/logger') |
30 | var routes = require('./routes') | 33 | var routes = require('./routes') |
31 | var api = require('./routes/api') | 34 | var api = require('./routes/api/' + global.API_VERSION) |
32 | var utils = require('./src/utils') | 35 | var utils = require('./src/utils') |
33 | var videos = require('./src/videos') | 36 | var videos = require('./src/videos') |
34 | var webtorrent = require('./src/webTorrentNode') | 37 | var webtorrent = require('./src/webTorrentNode') |
@@ -88,9 +91,10 @@ | |||
88 | } | 91 | } |
89 | 92 | ||
90 | // ----------- Routes ----------- | 93 | // ----------- Routes ----------- |
91 | app.use('/api/videos', api.videos) | 94 | var api_route = '/api/' + global.API_VERSION |
92 | app.use('/api/remotevideos', api.remoteVideos) | 95 | app.use(api_route + '/videos', api.videos) |
93 | app.use('/api/pods', api.pods) | 96 | app.use(api_route + '/remotevideos', api.remoteVideos) |
97 | app.use(api_route + '/pods', api.pods) | ||
94 | 98 | ||
95 | // ----------- Tracker ----------- | 99 | // ----------- Tracker ----------- |
96 | 100 | ||