diff --git a/src/config.ts b/src/config.ts index 409dc76..a83dd8d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -7,4 +7,5 @@ export default { imgur_client_id: process.env.RIMGU_IMGUR_CLIENT_ID || null, use_api: process.env.RIMGU_USE_API && process.env.RIMGU_USE_API !== 'false', page_title: process.env.RIMGU_PAGE_TITLE || 'rimgu', + debug: process.env.RIMGU_DEBUG && process.env.RIMGU_DEBUG !== 'false', }; diff --git a/src/index.ts b/src/index.ts index 1ff8625..bc07ca4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,9 +15,9 @@ const server = Hapi.server({ relativeTo: Path.join(__dirname, 'static') } }, - debug: { + debug: CONFIG.debug ? { request: ['error'] - }, + } : {}, }); server.events.on('stop', () => { console.log('Server stopped.');