https://github.com/moesif/moesif-koa-example
https://github.com/moesif/moesif-koa-example
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/moesif/moesif-koa-example
- Owner: Moesif
- License: other
- Created: 2020-10-10T02:13:44.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T22:55:53.000Z (about 2 years ago)
- Last Synced: 2025-01-05T21:12:03.153Z (9 months ago)
- Language: JavaScript
- Size: 85 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Moesif Koa Example
[Koa](https://koajs.com) is a popular web framework for Node.js.
[Moesif](https://www.moesif.com) is an API analytics platform.
[moesif-nodejs](https://github.com/Moesif/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.
## How to run this example.
1. Install all dependencies:
```bash
npm install
```2. Add your Moesif Application Id to the `index.js`
Your Moesif Application Id can be found in the [_Moesif Portal_](https://www.moesif.com/).
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_](https://www.moesif.com/), click on the top right menu,
and then clicking _Installation_.```javascript
var moesifOptions = {
applicationId: 'your application id',
}
```6. Run the example, it will listen on port 5000.
```bash
node index.js
```7. Send some requests to some of the routes and verify that the API calls are captured in your Moesif account.
```bash
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.