Koa is a popular web framework for Node.js.
Moesif is an API analytics platform. moesif-nodejs is a middleware that makes integration with Moesif easy for Nodejs based apps including Koa.
This example is a Koa application with Moesif's API analytics and monitoring integrated.
- Install all dependencies:
npm install
- Add your Moesif Application Id to the
index.js
Your Moesif Application Id can be found in the Moesif Portal. After signing up for a Moesif account, your Moesif Application Id will be displayed during the onboarding steps.
You can always find your Moesif Application Id at any time by logging into the Moesif Portal, click on the top right menu, and then clicking Installation.
var moesifOptions = {
applicationId: 'your application id',
}
- Run the example, it will listen on port 5000.
node index.js
- Send some requests to some of the routes and verify that the API calls are captured in your Moesif account.
curl http://localhost:5000
If you have the node index.js
running, you can also run npm test
to automatically trigger some API calls against the example server.