Skip to content

Commit

Permalink
add config option for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
diced committed Nov 12, 2020
1 parent 96c0a72 commit 27ec3de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/index.ts
Expand Up @@ -220,13 +220,7 @@ server.addHook('preHandler', async (req, reply) => {
});

server.addHook('onResponse', (req, res, done) => {
if (
!req.url.startsWith('/_next') &&
!req.url.startsWith('/api/upload') &&
!req.url.startsWith('/api/shorten') &&
!req.url.startsWith('/api/user') &&
!req.url.startsWith('/api/theme')
) {
if (!req.url.startsWith('/_next') && config.core.log) {
const status =
res.statusCode !== 200
? bold(red(res.statusCode.toString()))
Expand Down
1 change: 1 addition & 0 deletions src/lib/Config.ts
Expand Up @@ -49,6 +49,7 @@ export interface ConfigCore {
ratelimiter?: ConfigCoreRateLimiter;
theme?: 'dark' | 'light';
mfa?: boolean;
log?: boolean;
}

export interface ConfigWebhooks {
Expand Down

0 comments on commit 27ec3de

Please sign in to comment.