File tree Expand file tree Collapse file tree 2 files changed +39
-21
lines changed Expand file tree Collapse file tree 2 files changed +39
-21
lines changed Original file line number Diff line number Diff line change 1+ This a v7 version of the Express guide.
2+
3+ ``` javascript {tabTitle:CommonJS}
4+ // Require this first!
5+ require (" ./instrument" );
6+
7+ // Now require other modules
8+ const express = require (" express" );
9+ const Sentry = require (" @sentry/node" );
10+
11+ const app = express ();
12+
13+ // Add your routes, etc.
14+
15+ // Add this after all routes,
16+ // but before any and other error-handling middlewares are defined
17+ Sentry .setupExpressErrorHandler (app);
18+
19+ app .listen (3000 );
20+ ```
21+
22+ ``` javascript {tabTitle:ESM}
23+ // Import this first!
24+ import " ./instrument" ;
25+
26+ // Now import other modules
27+ import express from " express" ;
28+ import * as Sentry from " @sentry/node" ;
29+
30+ const app = express ();
31+
32+ // Add your routes, etc.
33+
34+ // Add this after all routes,
35+ // but before any and other error-handling middlewares are defined
36+ Sentry .setupExpressErrorHandler (app);
37+
38+ app .listen (3000 );
39+ ```
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments