Skip to content

Instantly share code, notes, and snippets.

@mknkisk
Created February 11, 2017 15:45
Show Gist options
  • Save mknkisk/19148b1d66cdb289a7a7bc81f2a39b1b to your computer and use it in GitHub Desktop.
Save mknkisk/19148b1d66cdb289a7a7bc81f2a39b1b to your computer and use it in GitHub Desktop.
Install client for airbrake (errbit) for express application
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