turn off logs on production

master
Lauren Liberda 2021-05-17 21:55:42 +02:00
parent 1fb7da56a8
commit 5c649d8a26
1 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import assert from 'assert';
const { DEST_SERVER, SERVER_PRETTY_NAME, LISTENING_PORT } = process.env;
assert(DEST_SERVER, 'missing DEST_SERVER env variable');
assert(SERVER_PRETTY_NAME, 'missing SERVER_PRETTY_NAME env variable');
const IS_PRODUCTION = process.env.NODE_ENV === 'production';
const FUCKED_UP_SERVERS = ['matrix.org'];
const got = Got.extend({
headers: {
@ -15,7 +16,7 @@ const got = Got.extend({
},
throwHttpErrors: false,
hooks: {
beforeRequest: [(req) => console.log(`${req.method} ${req.url.href}`)],
beforeRequest: IS_PRODUCTION ? [] : [(req) => console.log(`${req.method} ${req.url.href}`)],
},
});