Awesome
OpenResty with Moesif API Logging Example
Example Docker application using Moesif OpenResty plugin to log API calls to Moesif API analytics
To learn more about configuration options, please refer to Moesif OpenResty plugin.
How to run this example
- Clone this repo and edit the
nginx.conf.d/main.conf
file to set your actual Moesif Application Id.
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 API Keys.
- Build the docker image
docker build --no-cache -t openresty-docker-demo ./
- Start the docker container:
docker-compose up -d
By default, The container is listening on port 8000. You should now be able to make a request:
curl -X POST -H "Content-Type: application/json" -d '{"name":"moesif"}' "http://localhost:8000/api?x=2&y=4" -H 'User-Id:123' -H "Company-Id:567"
- The data should be captured in the corresponding Moesif account.
Congratulations! If everything was done correctly, Moesif should now be tracking all network requests that match the route you specified earlier. If you have any issues with set up, please reach out to support@moesif.com.