Session 10: Internal auth refactor, prefetch cascade keys, Sentry, welcome email (1286 tests)
This commit is contained in:
+12
@@ -1,4 +1,10 @@
|
||||
require('dotenv').config();
|
||||
// Session 10 — Sentry must initialize BEFORE express is required so
|
||||
// the instrumentation hooks attach correctly. Graceful no-op when
|
||||
// SENTRY_DSN is unset.
|
||||
const { initSentry, Sentry } = require('./utils/sentry');
|
||||
initSentry();
|
||||
|
||||
const express = require('express');
|
||||
const cors = require('cors');
|
||||
const oddsRoutes = require('./routes/odds');
|
||||
@@ -132,4 +138,10 @@ app.use('/api/grading', express.json({ limit: '256kb' }), correctionRoutes);
|
||||
const widgetRoutes = require('./routes/widget');
|
||||
app.use('/api/widget', widgetRoutes);
|
||||
|
||||
// Session 10 — Sentry's Express error handler catches uncaught
|
||||
// errors from every route mounted above. Must come AFTER routes but
|
||||
// BEFORE any final express error handler. The noop client makes this
|
||||
// a safe no-op when SENTRY_DSN is unset.
|
||||
Sentry.setupExpressErrorHandler(app);
|
||||
|
||||
module.exports = app;
|
||||
|
||||
Reference in New Issue
Block a user