aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-08-25 11:36:23 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-08-25 11:36:23 +0200
commit93e1258c7cbc0d1235ca6d2a1f7c1875985328b8 (patch)
treeb0a1f77af7ab54dc5f58f569fcd1e9d84b04c533 /server.ts
parent69f224587e99d56008e1fa129d0641840a486620 (diff)
downloadPeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.tar.gz
PeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.tar.zst
PeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.zip
Move video file metadata in their own table
Will be used for user video quotas and multiple video resolutions
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts20
1 files changed, 15 insertions, 5 deletions
diff --git a/server.ts b/server.ts
index 1ba208c28..2effa9340 100644
--- a/server.ts
+++ b/server.ts
@@ -26,7 +26,7 @@ const app = express()
26// ----------- Database ----------- 26// ----------- Database -----------
27// Do not use barrels because we don't want to load all modules here (we need to initialize database first) 27// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
28import { logger } from './server/helpers/logger' 28import { logger } from './server/helpers/logger'
29import { API_VERSION, CONFIG } from './server/initializers/constants' 29import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
30// Initialize database and models 30// Initialize database and models
31import { database as db } from './server/initializers/database' 31import { database as db } from './server/initializers/database'
32db.init(false).then(() => onDatabaseInitDone()) 32db.init(false).then(() => onDatabaseInitDone())
@@ -57,10 +57,20 @@ import { apiRouter, clientsRouter, staticRouter } from './server/controllers'
57 57
58// Enable CORS for develop 58// Enable CORS for develop
59if (isTestInstance()) { 59if (isTestInstance()) {
60 app.use(cors({ 60 app.use((req, res, next) => {
61 origin: 'http://localhost:3000', 61 // These routes have already cors
62 credentials: true 62 if (
63 })) 63 req.path.indexOf(STATIC_PATHS.TORRENTS) === -1 &&
64 req.path.indexOf(STATIC_PATHS.WEBSEED) === -1
65 ) {
66 return (cors({
67 origin: 'http://localhost:3000',
68 credentials: true
69 }))(req, res, next)
70 }
71
72 return next()
73 })
64} 74}
65 75
66// For the logger 76// For the logger