GithubHelp home page GithubHelp logo

bisk.api.gateway.poc's Introduction

API Gateway

We have:

  • An API gateway listening at http://localhost:7000

  • The routing is defined in the file ocelot.json in the ApiGateway project

  • An application management microservice listening at http://application-management:6000 with the following endpoints

    • /api/applications

    • /api/applications/{applicationId}

  • A programs selection microservice listening at http://product-selection:5000 with the following endpoints

    • /api/programs

    • /api/programs/{programId}

  • The API Gateway reroutes requests:

    • to /applications and /applications/{applicationId} to the application management microservice

    • to /programs and /programs/{programId} to the programs selection microservice

Running the application

  1. Navigate to this solution folder

  2. Execute the following command to run the application:

    docker-compose up -d --build
  3. Double check that the app is up and running:

    docker-compose ps
  4. Open another terminal window and navigate to this solution folder

  5. Follow the logs of the gateway component:

    docker-compose logs -f gateway

Testing the application

  1. Open another terminal window

  2. Make sure that the gateway is responding:

    curl http://localhost:7000/api/values

    it should reply with:

    value1, value2
  3. Try to access the applications and programs in their respective microservice:

    # this will be re-routed to http://application-management:6000/api/applications
    curl http://localhost:7000/applications
    
    # this will be re-routed to http://program-selection:5000/api/programs
    curl http://localhost:7000/programs
  4. Also try to get a single application or program:

    curl http://localhost:7000/applications/12
    curl http://localhost:7000/programs/5

Tear down application

  1. To tear down the application execute:

    docker-compose down -v

bisk.api.gateway.poc's People

Contributors

gnschenker avatar

Watchers

 avatar  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.