From e44c06132a4f1787bdc0be019bca9f01822d62cd Mon Sep 17 00:00:00 2001 From: Henri Remonen Date: Thu, 30 May 2024 10:37:26 +0300 Subject: [PATCH] refactore: remove debugging clogs --- src/server/db/connection.ts | 2 -- src/server/index.ts | 9 +-------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/server/db/connection.ts b/src/server/db/connection.ts index 00e45f40..d4fe3571 100644 --- a/src/server/db/connection.ts +++ b/src/server/db/connection.ts @@ -26,7 +26,6 @@ const runMigrations = async () => { } const testConnection = async () => { - console.log('Inside test connections') await sequelize.authenticate() await runMigrations() } @@ -35,7 +34,6 @@ const testConnection = async () => { const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)) export const connectToDatabase = async (attempt = 0): Promise => { - console.log('Inside connectToDb') try { await testConnection() } catch (err: any) { diff --git a/src/server/index.ts b/src/server/index.ts index 22973d15..3f358ae6 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -18,24 +18,17 @@ const app = express() app.use(['/api', '/public/api'], (req, res, next) => router(req, res, next)) app.use(['/api', '/public/api'], (_, res) => res.sendStatus(404)) -console.log('Before ifs') if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'test') { - console.log('Inside first if') const DIST_PATH = path.resolve( dirname(fileURLToPath(import.meta.url)), '../../build' ) - console.log('After dist path') + const INDEX_PATH = path.resolve(DIST_PATH, 'index.html') - console.log('After index path') app.use(express.static(DIST_PATH)) - console.log('After static') app.get('*', (_, res) => res.sendFile(INDEX_PATH)) - console.log('After get *') } -console.log('After first if') - app.listen(PORT, async () => { await connectToDatabase() await seed()