X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=server.ts;h=66dcb3c400cb584df8a342f245785219b4960e84;hb=5f46d28ccac4a20fcbb12c96a047a84a08e485ae;hp=f844c9564b5dacc37ac58cbb8f7d323816650891;hpb=12c1e38df2fde0efbf948fa80e2afc4e67f0e8c9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server.ts b/server.ts index f844c9564..66dcb3c40 100644 --- a/server.ts +++ b/server.ts @@ -159,9 +159,7 @@ morgan.token('user-agent', (req: express.Request) => { }) app.use(morgan('combined', { stream: { write: logger.info.bind(logger) }, - skip: function (req, res) { - return (req.path === '/api/v1/ping' && CONFIG.LOG.LOG_PING_REQUESTS === false) - }, + skip: req => CONFIG.LOG.LOG_PING_REQUESTS === false && req.originalUrl === '/api/v1/ping' })) // For body requests @@ -207,7 +205,8 @@ app.use('/', staticRouter) app.use('/', lazyStaticRouter) // Client files, last valid routes! -if (cli.client) app.use('/', clientsRouter) +const cliOptions = cli.opts() +if (cliOptions.client) app.use('/', clientsRouter) // ----------- Errors ----------- @@ -279,7 +278,7 @@ async function startApplication () { updateStreamingPlaylistsInfohashesIfNeeded() .catch(err => logger.error('Cannot update streaming playlist infohashes.', { err })) - if (cli.plugins) await PluginManager.Instance.registerPluginsAndThemes() + if (cliOptions.plugins) await PluginManager.Instance.registerPluginsAndThemes() LiveManager.Instance.init() if (CONFIG.LIVE.ENABLED) LiveManager.Instance.run()