From f253b1c1f19d9cb056ab95b2cb6208952e073894 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Oct 2016 12:16:28 +0200 Subject: [PATCH] Server: remove v1 directory, we don't really need it --- server/controllers/api/{v1 => }/clients.js | 2 +- server/controllers/api/{v1 => }/index.js | 0 server/controllers/api/{v1 => }/pods.js | 6 +++--- server/controllers/api/{v1 => }/remote.js | 4 ++-- server/controllers/api/{v1 => }/requests.js | 4 ++-- server/controllers/api/{v1 => }/users.js | 8 ++++---- server/controllers/api/{v1 => }/videos.js | 10 +++++----- server/controllers/index.js | 4 +--- 8 files changed, 18 insertions(+), 20 deletions(-) rename server/controllers/api/{v1 => }/clients.js (94%) rename server/controllers/api/{v1 => }/index.js (100%) rename server/controllers/api/{v1 => }/pods.js (95%) rename server/controllers/api/{v1 => }/remote.js (96%) rename server/controllers/api/{v1 => }/requests.js (88%) rename server/controllers/api/{v1 => }/users.js (94%) rename server/controllers/api/{v1 => }/videos.js (95%) diff --git a/server/controllers/api/v1/clients.js b/server/controllers/api/clients.js similarity index 94% rename from server/controllers/api/v1/clients.js rename to server/controllers/api/clients.js index 5b460db2e..ce1149227 100644 --- a/server/controllers/api/v1/clients.js +++ b/server/controllers/api/clients.js @@ -3,7 +3,7 @@ const express = require('express') const mongoose = require('mongoose') -const constants = require('../../../initializers/constants') +const constants = require('../../initializers/constants') const Client = mongoose.model('OAuthClient') diff --git a/server/controllers/api/v1/index.js b/server/controllers/api/index.js similarity index 100% rename from server/controllers/api/v1/index.js rename to server/controllers/api/index.js diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/pods.js similarity index 95% rename from server/controllers/api/v1/pods.js rename to server/controllers/api/pods.js index 2f4621327..853e0705b 100644 --- a/server/controllers/api/v1/pods.js +++ b/server/controllers/api/pods.js @@ -4,9 +4,9 @@ const express = require('express') const mongoose = require('mongoose') const waterfall = require('async/waterfall') -const logger = require('../../../helpers/logger') -const friends = require('../../../lib/friends') -const middlewares = require('../../../middlewares') +const logger = require('../../helpers/logger') +const friends = require('../../lib/friends') +const middlewares = require('../../middlewares') const admin = middlewares.admin const oAuth = middlewares.oauth const podsMiddleware = middlewares.pods diff --git a/server/controllers/api/v1/remote.js b/server/controllers/api/remote.js similarity index 96% rename from server/controllers/api/v1/remote.js rename to server/controllers/api/remote.js index a22c5d151..17b1d07c4 100644 --- a/server/controllers/api/v1/remote.js +++ b/server/controllers/api/remote.js @@ -5,10 +5,10 @@ const eachSeries = require('async/eachSeries') const express = require('express') const mongoose = require('mongoose') -const middlewares = require('../../../middlewares') +const middlewares = require('../../middlewares') const secureMiddleware = middlewares.secure const validators = middlewares.validators.remote -const logger = require('../../../helpers/logger') +const logger = require('../../helpers/logger') const router = express.Router() const Video = mongoose.model('Video') diff --git a/server/controllers/api/v1/requests.js b/server/controllers/api/requests.js similarity index 88% rename from server/controllers/api/v1/requests.js rename to server/controllers/api/requests.js index 97616424d..52aad6997 100644 --- a/server/controllers/api/v1/requests.js +++ b/server/controllers/api/requests.js @@ -3,8 +3,8 @@ const express = require('express') const mongoose = require('mongoose') -const constants = require('../../../initializers/constants') -const middlewares = require('../../../middlewares') +const constants = require('../../initializers/constants') +const middlewares = require('../../middlewares') const admin = middlewares.admin const oAuth = middlewares.oauth diff --git a/server/controllers/api/v1/users.js b/server/controllers/api/users.js similarity index 94% rename from server/controllers/api/v1/users.js rename to server/controllers/api/users.js index 975e25e68..b4d687312 100644 --- a/server/controllers/api/v1/users.js +++ b/server/controllers/api/users.js @@ -5,10 +5,10 @@ const express = require('express') const mongoose = require('mongoose') const waterfall = require('async/waterfall') -const constants = require('../../../initializers/constants') -const friends = require('../../../lib/friends') -const logger = require('../../../helpers/logger') -const middlewares = require('../../../middlewares') +const constants = require('../../initializers/constants') +const friends = require('../../lib/friends') +const logger = require('../../helpers/logger') +const middlewares = require('../../middlewares') const admin = middlewares.admin const oAuth = middlewares.oauth const pagination = middlewares.pagination diff --git a/server/controllers/api/v1/videos.js b/server/controllers/api/videos.js similarity index 95% rename from server/controllers/api/v1/videos.js rename to server/controllers/api/videos.js index ee47ce7ac..e2d393074 100644 --- a/server/controllers/api/v1/videos.js +++ b/server/controllers/api/videos.js @@ -5,10 +5,10 @@ const mongoose = require('mongoose') const multer = require('multer') const waterfall = require('async/waterfall') -const constants = require('../../../initializers/constants') -const logger = require('../../../helpers/logger') -const friends = require('../../../lib/friends') -const middlewares = require('../../../middlewares') +const constants = require('../../initializers/constants') +const logger = require('../../helpers/logger') +const friends = require('../../lib/friends') +const middlewares = require('../../middlewares') const oAuth = middlewares.oauth const pagination = middlewares.pagination const validators = middlewares.validators @@ -17,7 +17,7 @@ const validatorsSort = validators.sort const validatorsVideos = validators.videos const search = middlewares.search const sort = middlewares.sort -const utils = require('../../../helpers/utils') +const utils = require('../../helpers/utils') const router = express.Router() const Video = mongoose.model('Video') diff --git a/server/controllers/index.js b/server/controllers/index.js index 4c1d3dafe..6a3f3f98f 100644 --- a/server/controllers/index.js +++ b/server/controllers/index.js @@ -1,8 +1,6 @@ 'use strict' -const constants = require('../initializers/constants') - -const apiController = require('./api/' + constants.API_VERSION) +const apiController = require('./api/') module.exports = { api: apiController -- 2.25.1