-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathserver-traceStaticAssets.js
More file actions
38 lines (28 loc) · 1010 Bytes
/
server-traceStaticAssets.js
File metadata and controls
38 lines (28 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const { loggingTransport } = require('@sentry-internal/node-integration-tests');
const Sentry = require('@sentry/node');
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
release: '1.0',
tracesSampleRate: 1.0,
transport: loggingTransport,
integrations: [Sentry.httpIntegration({ ignoreStaticAssets: false })],
});
const express = require('express');
const cors = require('cors');
const { startExpressServerAndSendPortToRunner } = require('@sentry-internal/node-integration-tests');
const app = express();
app.use(cors());
app.get('/test', (_req, res) => {
res.send({ response: 'ok' });
});
app.get('/favicon.ico', (_req, res) => {
res.type('image/x-icon').send(Buffer.from([0]));
});
app.get('/robots.txt', (_req, res) => {
res.type('text/plain').send('User-agent: *\nDisallow:\n');
});
app.get('/assets/app.js', (_req, res) => {
res.type('application/javascript').send('/* js */');
});
Sentry.setupExpressErrorHandler(app);
startExpressServerAndSendPortToRunner(app);