New directory organization

This commit is contained in:
Chocobozzz 2016-01-30 17:05:22 +01:00
parent 86435b9bae
commit cda021079f
40 changed files with 40 additions and 41 deletions

View File

@ -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}',

View File

@ -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) {

View File

@ -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) {

View File

@ -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')

View File

@ -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),

View File

@ -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 = {}

View File

@ -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')

View File

@ -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 = {}

View File

@ -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')

View File

@ -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 = {}

View File

@ -2,7 +2,7 @@
'use strict'
var checkErrors = require('./utils').checkErrors
var logger = require('../../src/logger')
var logger = require('../../helpers/logger')
var pods = {}

View File

@ -2,7 +2,7 @@
'use strict'
var checkErrors = require('./utils').checkErrors
var logger = require('../../src/logger')
var logger = require('../../helpers/logger')
var remote = {}

View File

@ -2,7 +2,7 @@
'use strict'
var util = require('util')
var logger = require('../../src/logger')
var logger = require('../../helpers/logger')
var utils = {}

View File

@ -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 = {}

View File

@ -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 = {}

View File

@ -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 = {}

View File

@ -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",

View File

@ -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')

View File

@ -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 () {

View File

@ -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')