add config option for logging

This commit is contained in:
diced
2020-11-12 09:30:44 -08:00
parent 96c0a72178
commit 27ec3de3ac
2 changed files with 2 additions and 7 deletions

View File

@@ -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()))

View File

@@ -49,6 +49,7 @@ export interface ConfigCore {
ratelimiter?: ConfigCoreRateLimiter;
theme?: 'dark' | 'light';
mfa?: boolean;
log?: boolean;
}
export interface ConfigWebhooks {