diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-11 21:50:51 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-19 21:22:28 +0100 |
commit | feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c (patch) | |
tree | 2abc9fbc9569760e218fd52835850b757344b420 /server.js | |
parent | 108626609eda75e4ecc0a83a650a4d53c46220e0 (diff) | |
download | PeerTube-feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c.tar.gz PeerTube-feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c.tar.zst PeerTube-feb4bdfd9b46e87aadfa7c0d5338cde887d1f58c.zip |
First version with PostgreSQL
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -17,10 +17,9 @@ const app = express() | |||
17 | 17 | ||
18 | // ----------- Database ----------- | 18 | // ----------- Database ----------- |
19 | const constants = require('./server/initializers/constants') | 19 | const constants = require('./server/initializers/constants') |
20 | const database = require('./server/initializers/database') | ||
21 | const logger = require('./server/helpers/logger') | 20 | const logger = require('./server/helpers/logger') |
22 | 21 | // Initialize database and models | |
23 | database.connect() | 22 | const db = require('./server/initializers/database') |
24 | 23 | ||
25 | // ----------- Checker ----------- | 24 | // ----------- Checker ----------- |
26 | const checker = require('./server/initializers/checker') | 25 | const checker = require('./server/initializers/checker') |
@@ -39,9 +38,7 @@ if (errorMessage !== null) { | |||
39 | const customValidators = require('./server/helpers/custom-validators') | 38 | const customValidators = require('./server/helpers/custom-validators') |
40 | const installer = require('./server/initializers/installer') | 39 | const installer = require('./server/initializers/installer') |
41 | const migrator = require('./server/initializers/migrator') | 40 | const migrator = require('./server/initializers/migrator') |
42 | const mongoose = require('mongoose') | ||
43 | const routes = require('./server/controllers') | 41 | const routes = require('./server/controllers') |
44 | const Request = mongoose.model('Request') | ||
45 | 42 | ||
46 | // ----------- Command line ----------- | 43 | // ----------- Command line ----------- |
47 | 44 | ||
@@ -130,7 +127,7 @@ installer.installApplication(function (err) { | |||
130 | // ----------- Make the server listening ----------- | 127 | // ----------- Make the server listening ----------- |
131 | server.listen(port, function () { | 128 | server.listen(port, function () { |
132 | // Activate the pool requests | 129 | // Activate the pool requests |
133 | Request.activate() | 130 | db.Request.activate() |
134 | 131 | ||
135 | logger.info('Server listening on port %d', port) | 132 | logger.info('Server listening on port %d', port) |
136 | logger.info('Webserver: %s', constants.CONFIG.WEBSERVER.URL) | 133 | logger.info('Webserver: %s', constants.CONFIG.WEBSERVER.URL) |