Skip to content
Branch: master
Find file History
Pull request Compare This branch is 3 commits behind next.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
static
views
.dockerignore
Dockerfile
README.md
app.js
package-lock.json
package.json

README.md

Koa

This is an example project showing how to use @bugsnag/js with a Koa application.

Usage

Clone the repo and cd into the directory of this example:

git clone git@github.com:bugsnag/bugsnag-js.git
cd bugsnag-js/examples/koa

Use the instructions below to run the application.

Once started, it will serve a page at http://localhost:9872 with buttons that cause the server to send various errors.

Note that if you hit the button that crashes the server, you will need to restart it again!

With docker

The project includes a Dockerfile. If you're familiar with docker, this is the easiest way to start the example. Otherwise, skip ahead to the without docker section.

docker build -t bugsnag-js-example-koa . && \
docker run -p 9872:9872 -it -e BUGSNAG_API_KEY='YOUR_API_KEY' bugsnag-js-example-koa

Note: remember to replace YOUR_API_KEY in the command with your own!

Without docker

Ensure you have a version of Node.js >=8 on your machine.

npm install
BUGSNAG_API_KEY=YOUR_API_KEY npm start

Note: remember to replace YOUR_API_KEY in the command with your own!

You can’t perform that action at this time.