-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathscenario.mjs
More file actions
28 lines (22 loc) · 693 Bytes
/
scenario.mjs
File metadata and controls
28 lines (22 loc) · 693 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
import * as Sentry from '@sentry/node';
import { startExpressServerAndSendPortToRunner } from '@sentry-internal/node-integration-tests';
import express from 'express';
import http from 'http';
const app = express();
app.get('/test', (_req, res) => {
http.get(`http://localhost:${app.port}/test2`, httpRes => {
httpRes.on('data', () => {
setTimeout(() => {
res.send({ response: 'response 1' });
}, 200);
});
});
});
app.get('/test2', (_req, res) => {
res.send({ response: 'response 2' });
});
app.get('/test3', (_req, res) => {
res.send({ response: 'response 3' });
});
Sentry.setupExpressErrorHandler(app);
startExpressServerAndSendPortToRunner(app);