Skip to content
This repository was archived by the owner on Jun 14, 2021. It is now read-only.

Commit 96854d4

Browse files
author
XiaoLin
committed
feat: Sentry error tracking
1 parent 44d159d commit 96854d4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/api/init.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ const cookieParser = require('cookie-parser')
66
const user = require('./../module/user')
77
const config = require('./../module/config')
88
const cache = require('./../module/cache')
9+
const Sentry = require('@sentry/node')
910

1011
const pathPrefix = config.get('system.path')
1112

13+
Sentry.init({
14+
dsn: 'https://[email protected]/5217379'
15+
})
16+
17+
app.use(Sentry.Handlers.requestHandler())
18+
app.use(Sentry.Handlers.errorHandler())
19+
1220
app.use(cookieParser())
1321
app.use(bodyParser.json())
1422

0 commit comments

Comments
 (0)