GithubHelp home page GithubHelp logo

isabella232 / moesif-3scale-api-gateway-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moesif/moesif-3scale-api-gateway-example

0.0 0.0 0.0 8 KB

An Example of 3Scale Integration with Moesif

Dockerfile 100.00%

moesif-3scale-api-gateway-example's Introduction

3Scale 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

  1. Clone this repo and edit the init.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.

  1. Edit the Dockerfile to set the following details:
  • Provide the 3Scle ACCESS_TOKEN and ADMIN_PORTAL_DOMAIN detail to the THREESCALE_PORTAL_ENDPOINT env variable. You would find the ACCESS_TOKEN and ADMIN_PORTAL_DOMAIN by configuring 3Scale.

  • Provide the RedHat credentials (UserName/Password) for registering subscription-manager at RedHat

  1. Build the docker image
docker build . --tag apicast:latest
  1. Start the docker container:
docker run -p 8080:8080 -d apicast:latest

By default, The container is listening on port 8080. You should now be able to make a request:

If you configured 3scale to authenticate via a single user_key string:

curl -X POST -H "Content-Type: application/json" -d '{"name":"moesif"}' "http://localhost:8080/api/user?user_key=user_key"

If you configured 3scale to authenticate via app_id and app_key pair:

curl -X POST -H "Content-Type: application/json" -d '{"name":"moesif"}' "http://localhost:8080/api/user" -H 'app_id:app_id' -H "app_key:app_key"
  1. 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 [email protected].

moesif-3scale-api-gateway-example's People

Contributors

dgilling avatar keyur9 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.