Building a routing API

I need to create an API that basically exposes specific URI endpoints and maps them to any number of backend urls.

So the API will have mappings in Mongo like this:

{"name": "example", "from": "/resources", "to": "http://backendservice.com/1/billing", "method": "POST"}

{"name": "example1", "from": "/resources/:id", "to": "http://backendservice.com/1/billing/:id", "method": "GET"}

{"name": "example2", "from": "/somethingelse/*", "to": "http://google.com/foo/*", "method": "ANY"}

      

The goal is to have a single entry point that all of our clients can use to access all of the different services. It also allows for easier logging and reporting.

Therefore, if we request api.example.org/resources, the system matches the incoming request URL with the target URL. Makes a request to the destination and receives a response, logs in appropriately, and handles any errors. Has the meaning?

My question (s):

Are there any open source solutions that do this?

What frameworks / libraries, etc. would you suggest as a good starting point. I looked at Goliath (Ruby) but not limited to any language as long as it works open source and Linux.

Thank.

+3


source to share


3 answers


I decided to go with the Umbrella API.

https://github.com/NREL/api-umbrella



It provides exactly what I need. Built with Ruby, uses mongo, does routing. Perfect.

+2


source


If you want to go beyond Ruby, you can use the Python Flask library . Alternatively, you can do it with Ruby's built-in WEBrick HTTP Server Library. Just create a servlet that does a dictionary lookup of URLs, or create many servlets dynamically using metaprogramming and mount them on different URLs.



0


source


WSO2API Manager is a completely open source product available under the apcheV2 license.

Where can you achieve this multiple endpoint configuration using APIManager and ESB. When you publish the API, you may need to specify one service endpoint (it can be a proxy / other REST API endpoint on wso2esb), and from the ESB end, you can route requests to multiple endpoints based on the request.

0


source







All Articles