New directory organization
This commit is contained in:
parent
86435b9bae
commit
cda021079f
|
@ -8,8 +8,7 @@ module.exports = function (grunt) {
|
|||
scss: 'public/stylesheets/application.scss',
|
||||
vendor: 'public/stylesheets/vendor',
|
||||
js: 'public/javascripts/*.js',
|
||||
src: 'src/*.js',
|
||||
routes: 'routes/**/*.js',
|
||||
routes: 'controllers/**/*.js',
|
||||
main: './server.js',
|
||||
browserified: 'public/javascripts/bundle.js',
|
||||
img: 'public/images/*.{png,jpg,jpeg,gif,webp,svg}',
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
var miscMiddleware = middleware.misc
|
||||
var reqValidator = middleware.reqValidators.pods
|
||||
var secureRequest = middleware.reqValidators.remote.secureRequest
|
||||
var pods = require('../../../src/pods')
|
||||
var pods = require('../../../models/pods')
|
||||
|
||||
function listPods (req, res, next) {
|
||||
pods.list(function (err, pods_list) {
|
|
@ -8,7 +8,7 @@
|
|||
var middleware = require('../../../middlewares')
|
||||
var miscMiddleware = middleware.misc
|
||||
var reqValidator = middleware.reqValidators.remote
|
||||
var videos = require('../../../src/videos')
|
||||
var videos = require('../../../models/videos')
|
||||
|
||||
function addRemoteVideos (req, res, next) {
|
||||
videos.addRemotes(req.body.data, function (err, videos) {
|
|
@ -10,7 +10,7 @@
|
|||
var middleware = require('../../../middlewares')
|
||||
var miscMiddleware = middleware.misc
|
||||
var reqValidator = middleware.reqValidators.videos
|
||||
var videos = require('../../../src/videos')
|
||||
var videos = require('../../../models/videos')
|
||||
|
||||
var uploads = config.get('storage.uploads')
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
;(function () {
|
||||
'use strict'
|
||||
|
||||
var constants = require('../src/constants')
|
||||
var constants = require('../initializers/constants')
|
||||
|
||||
var routes = {
|
||||
api: require('./api/' + constants.API_VERSION),
|
|
@ -10,7 +10,7 @@
|
|||
var replay = require('request-replay')
|
||||
var ursa = require('ursa')
|
||||
|
||||
var constants = require('./constants')
|
||||
var constants = require('../initializers/constants')
|
||||
var logger = require('./logger')
|
||||
|
||||
var utils = {}
|
|
@ -5,7 +5,7 @@
|
|||
var mongoose = require('mongoose')
|
||||
|
||||
var constants = require('./constants')
|
||||
var logger = require('./logger')
|
||||
var logger = require('../helpers/logger')
|
||||
|
||||
var dbname = 'peertube' + config.get('database.suffix')
|
||||
var host = config.get('database.host')
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
var async = require('async')
|
||||
|
||||
var constants = require('./constants')
|
||||
var logger = require('./logger')
|
||||
var database = require('./database')
|
||||
var constants = require('../initializers/constants')
|
||||
var logger = require('../helpers/logger')
|
||||
var database = require('../initializers/database')
|
||||
var pluck = require('lodash-node/compat/collection/pluck')
|
||||
var PoolRequestsDB = database.PoolRequestsDB
|
||||
var PodsDB = database.PodsDB
|
||||
var utils = require('./utils')
|
||||
var utils = require('../helpers/utils')
|
||||
var VideosDB = database.VideosDB
|
||||
|
||||
var poolRequests = {}
|
|
@ -6,7 +6,7 @@
|
|||
var pathUtils = require('path')
|
||||
var spawn = require('electron-spawn')
|
||||
|
||||
var logger = require('./logger')
|
||||
var logger = require('../helpers/logger')
|
||||
|
||||
var host = config.get('webserver.host')
|
||||
var port = config.get('webserver.port')
|
|
@ -4,9 +4,9 @@
|
|||
var ursa = require('ursa')
|
||||
var fs = require('fs')
|
||||
|
||||
var logger = require('../src/logger')
|
||||
var utils = require('../src/utils')
|
||||
var PodsDB = require('../src/database').PodsDB
|
||||
var logger = require('../helpers/logger')
|
||||
var utils = require('../helpers/utils')
|
||||
var PodsDB = require('../initializers/database').PodsDB
|
||||
|
||||
var misc = {}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
'use strict'
|
||||
|
||||
var checkErrors = require('./utils').checkErrors
|
||||
var logger = require('../../src/logger')
|
||||
var logger = require('../../helpers/logger')
|
||||
|
||||
var pods = {}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
'use strict'
|
||||
|
||||
var checkErrors = require('./utils').checkErrors
|
||||
var logger = require('../../src/logger')
|
||||
var logger = require('../../helpers/logger')
|
||||
|
||||
var remote = {}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
'use strict'
|
||||
|
||||
var util = require('util')
|
||||
var logger = require('../../src/logger')
|
||||
var logger = require('../../helpers/logger')
|
||||
|
||||
var utils = {}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
'use strict'
|
||||
|
||||
var checkErrors = require('./utils').checkErrors
|
||||
var VideosDB = require('../../src/database').VideosDB
|
||||
var logger = require('../../src/logger')
|
||||
var VideosDB = require('../../initializers/database').VideosDB
|
||||
var logger = require('../../helpers/logger')
|
||||
|
||||
var videos = {}
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
var fs = require('fs')
|
||||
var request = require('request')
|
||||
|
||||
var constants = require('./constants')
|
||||
var logger = require('./logger')
|
||||
var PodsDB = require('./database').PodsDB
|
||||
var poolRequests = require('./poolRequests')
|
||||
var utils = require('./utils')
|
||||
var constants = require('../initializers/constants')
|
||||
var logger = require('../helpers/logger')
|
||||
var PodsDB = require('../initializers/database').PodsDB
|
||||
var poolRequests = require('../lib/poolRequests')
|
||||
var utils = require('../helpers/utils')
|
||||
|
||||
var pods = {}
|
||||
|
|
@ -5,11 +5,11 @@
|
|||
var config = require('config')
|
||||
var dz = require('dezalgo')
|
||||
var fs = require('fs')
|
||||
var webtorrent = require('./webTorrentNode')
|
||||
var webtorrent = require('../lib/webTorrentNode')
|
||||
|
||||
var logger = require('./logger')
|
||||
var logger = require('../helpers/logger')
|
||||
var pods = require('./pods')
|
||||
var VideosDB = require('./database').VideosDB
|
||||
var VideosDB = require('../initializers/database').VideosDB
|
||||
|
||||
var videos = {}
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"start": "grunt dev",
|
||||
"test": "grunt build && standard && mocha test"
|
||||
"test": "grunt build && standard && mocha tests"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "^1.2.1",
|
||||
|
|
18
server.js
18
server.js
|
@ -15,7 +15,7 @@
|
|||
var app = express()
|
||||
|
||||
// ----------- Checker -----------
|
||||
var checker = require('./src/checker')
|
||||
var checker = require('./initializers/checker')
|
||||
|
||||
var miss = checker.checkConfig()
|
||||
if (miss.length !== 0) {
|
||||
|
@ -28,14 +28,14 @@
|
|||
|
||||
// ----------- PeerTube modules -----------
|
||||
var config = require('config')
|
||||
var constants = require('./src/constants')
|
||||
var customValidators = require('./src/customValidators')
|
||||
var logger = require('./src/logger')
|
||||
var poolRequests = require('./src/poolRequests')
|
||||
var routes = require('./routes')
|
||||
var utils = require('./src/utils')
|
||||
var videos = require('./src/videos')
|
||||
var webtorrent = require('./src/webTorrentNode')
|
||||
var constants = require('./initializers/constants')
|
||||
var customValidators = require('./helpers/customValidators')
|
||||
var logger = require('./helpers/logger')
|
||||
var poolRequests = require('./lib/poolRequests')
|
||||
var routes = require('./controllers')
|
||||
var utils = require('./helpers/utils')
|
||||
var videos = require('./models/videos')
|
||||
var webtorrent = require('./lib/webTorrentNode')
|
||||
|
||||
// Get configurations
|
||||
var port = config.get('listen.port')
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
var expect = chai.expect
|
||||
|
||||
var utils = require('./utils')
|
||||
var webtorrent = require(__dirname + '/../../src/webTorrentNode')
|
||||
var webtorrent = require(__dirname + '/../../lib/webTorrentNode')
|
||||
webtorrent.silent = true
|
||||
|
||||
describe('Test multiple pods', function () {
|
|
@ -6,7 +6,7 @@
|
|||
var fs = require('fs')
|
||||
var expect = chai.expect
|
||||
|
||||
var webtorrent = require(__dirname + '/../../src/webTorrentNode')
|
||||
var webtorrent = require(__dirname + '/../../lib/webTorrentNode')
|
||||
webtorrent.silent = true
|
||||
|
||||
var utils = require('./utils')
|
Loading…
Reference in New Issue