chore: disable sentry on backend
This commit is contained in:
+11
-11
@@ -4,8 +4,8 @@ const express = require('express');
|
|||||||
const rateLimit = require('express-rate-limit');
|
const rateLimit = require('express-rate-limit');
|
||||||
const cors = require('cors');
|
const cors = require('cors');
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
const sentry = require('@sentry/node');
|
// const sentry = require('@sentry/node');
|
||||||
const { ProfilingIntegration } = require('@sentry/profiling-node');
|
// const { ProfilingIntegration } = require('@sentry/profiling-node');
|
||||||
|
|
||||||
const uploadVideo = require('./src/routes/uploadVideo');
|
const uploadVideo = require('./src/routes/uploadVideo');
|
||||||
const downloadCertificate = require('./src/routes/downloadCertificate');
|
const downloadCertificate = require('./src/routes/downloadCertificate');
|
||||||
@@ -14,12 +14,12 @@ const downloadCourse = require('./src/routes/downloadCourse');
|
|||||||
const katex = require('./src/routes/katex');
|
const katex = require('./src/routes/katex');
|
||||||
const sendEmail = require('./src/routes/sendEmail');
|
const sendEmail = require('./src/routes/sendEmail');
|
||||||
|
|
||||||
sentry.init({
|
// sentry.init({
|
||||||
dsn: process.env.SENTRY_DNS || '',
|
// dsn: process.env.SENTRY_DNS || '',
|
||||||
integrations: [new ProfilingIntegration()],
|
// integrations: [new ProfilingIntegration()],
|
||||||
tracesSampleRate: 1.0,
|
// tracesSampleRate: 1.0,
|
||||||
profilesSampleRate: 1.0
|
// profilesSampleRate: 1.0
|
||||||
});
|
// });
|
||||||
|
|
||||||
// Express server
|
// Express server
|
||||||
const app = express();
|
const app = express();
|
||||||
@@ -38,8 +38,8 @@ const limiter = rateLimit({
|
|||||||
app.use(limiter);
|
app.use(limiter);
|
||||||
|
|
||||||
// Integrate Sentry middleware
|
// Integrate Sentry middleware
|
||||||
app.use(sentry.Handlers.requestHandler());
|
// app.use(sentry.Handlers.requestHandler());
|
||||||
app.use(sentry.Handlers.errorHandler());
|
// app.use(sentry.Handlers.errorHandler());
|
||||||
|
|
||||||
// Register routes
|
// Register routes
|
||||||
app.use('/downloadCertificate', downloadCertificate);
|
app.use('/downloadCertificate', downloadCertificate);
|
||||||
@@ -68,7 +68,7 @@ app.use((error, req, res, next) => {
|
|||||||
console.error('Exception error caught:', error);
|
console.error('Exception error caught:', error);
|
||||||
|
|
||||||
// Capture and send the error to Sentry
|
// Capture and send the error to Sentry
|
||||||
sentry.captureException(error);
|
// sentry.captureException(error);
|
||||||
|
|
||||||
// Respond with a 500 Internal Server Error
|
// Respond with a 500 Internal Server Error
|
||||||
res.status(500).json({ error: 'Internal Server Error' });
|
res.status(500).json({ error: 'Internal Server Error' });
|
||||||
|
|||||||
Generated
+8232
-10378
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user