Express is a very 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 Express.
This example is an express application with Moesif's API analytics and monitoring integrated.
- Install all dependencies:
npm install
- Add your Moesif Application Id to
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, clicking on the bottom-left 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.