installing sentry

This commit is contained in:
Nikola Bjelo committed 2018-10-20 06:54:40 +02:00
1 parent 099f545559
commit 708ab25a74
4 files changed
+106 -23

No files matched your search

+8
View File
@@ -8,10 +8,15 @@ import jwt from 'express-jwt'
import jwksRsa from 'jwks-rsa'
import schema from './schema'
const Sentry = require('@sentry/node')
// Initialise express
const app = express()
// Initialising sentry
Sentry.init({ dsn: process.env.SENTRY_DNS })
app.use(Sentry.Handlers.requestHandler())
// Allow cross origing request
app.use(cors())
/* -------------------------------------------------
@@ -63,6 +68,9 @@ app.use('/graphql', graphqlHTTP(req => {
}))
app.get('/playground', expressPlayground({ endpoint: '/graphql' }))
// Sentry error handling middleware
app.use(Sentry.Handlers.errorHandler())
app.listen(process.env.PORT, () => {
console.log(`Listening on port ${process.env.PORT}`)
})