Skip to content

Commit 27ec3de

Browse files
committed
add config option for logging
1 parent 96c0a72 commit 27ec3de

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,7 @@ server.addHook('preHandler', async (req, reply) => {
220220
});
221221

222222
server.addHook('onResponse', (req, res, done) => {
223-
if (
224-
!req.url.startsWith('/_next') &&
225-
!req.url.startsWith('/api/upload') &&
226-
!req.url.startsWith('/api/shorten') &&
227-
!req.url.startsWith('/api/user') &&
228-
!req.url.startsWith('/api/theme')
229-
) {
223+
if (!req.url.startsWith('/_next') && config.core.log) {
230224
const status =
231225
res.statusCode !== 200
232226
? bold(red(res.statusCode.toString()))

src/lib/Config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface ConfigCore {
4949
ratelimiter?: ConfigCoreRateLimiter;
5050
theme?: 'dark' | 'light';
5151
mfa?: boolean;
52+
log?: boolean;
5253
}
5354

5455
export interface ConfigWebhooks {

0 commit comments

Comments
 (0)