Created
February 11, 2017 15:45
-
-
Save mknkisk/19148b1d66cdb289a7a7bc81f2a39b1b to your computer and use it in GitHub Desktop.
Install client for airbrake (errbit) for express application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const airbrake = require('airbrake').createClient("your project ID", "your api key") | |
// errbit run on localhost | |
airbrake.protocol = 'http' | |
airbrake.serviceHost = 'localhost:3001' | |
// By default only the errors from the production environment will get reported | |
// If you put 'production' in airbrake.env, errors will reported | |
airbrake.env = 'production' | |
// routing | |
app.use('/', index) | |
app.use('/users', users) | |
// airbrake error handler | |
app.use(airbrake.expressHandler()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment