]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.ts
Split files in activitypub server
[github/Chocobozzz/PeerTube.git] / server.ts
index 06d575c861c8d7ae705075b9e1beed18bfc3e5a6..bdcbb79886fe874c57d31ebef2853853fc2e1a5e 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -95,7 +95,7 @@ if (isTestInstance()) {
       req.path.indexOf(STATIC_PATHS.WEBSEED) === -1
     ) {
       return (cors({
-        origin: 'http://localhost:3000',
+        origin: '*',
         exposedHeaders: 'Retry-After',
         credentials: true
       }))(req, res, next)
@@ -194,6 +194,7 @@ app.use(function (err, req, res, next) {
 
 async function startApplication () {
   const port = CONFIG.LISTEN.PORT
+  const hostname = CONFIG.LISTEN.HOSTNAME
 
   await installApplication()
 
@@ -214,7 +215,8 @@ async function startApplication () {
   Redis.Instance.init()
 
   // Make server listening
-  server.listen(port)
-  logger.info('Server listening on port %d', port)
-  logger.info('Web server: %s', CONFIG.WEBSERVER.URL)
+  server.listen(port, hostname, () => {
+    logger.info('Server listening on %s:%d', hostname, port)
+    logger.info('Web server: %s', CONFIG.WEBSERVER.URL)
+  })
 }