Skip to content

Commit a807526

Browse files
authored
Add manual Express wrapper example. (#5425)
1 parent 209069a commit a807526

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/includes/getting-started-config/javascript.remix.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ Learn more about <Link to="/platforms/node/performance/database/opt-in/#prisma-o
4242

4343
</Note>
4444

45+
If you use a custom Express server in your Remix application, you should wrap your [`createRequestHandler` function](https://remix.run/docs/en/v1/other-api/adapter#createrequesthandler) manually with `wrapExpressCreateRequestHandler`. This is not required if you use the built-in Remix App Server.
46+
47+
48+
```typescript {filename: server/index.ts}
49+
import { wrapExpressCreateRequestHandler } from "@sentry/remix";
50+
import { createRequestHandler } from '@remix-run/express';
51+
52+
//...
53+
app.all('*', wrapExpressCreateRequestHandler(createRequestHandler)(/* ... */));
54+
```
55+
4556
Also, wrap your Remix root with `withSentry` to catch React component errors and to get parameterized router transactions.
4657

4758
```typescript {filename: root.tsx}

0 commit comments

Comments
 (0)