I need to build a API that basically exposes certain URI endpoints and maps them to any number of backend URL's.
So the API would 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 purpose here is to have a single entry point all our clients can use to access all the various services. It also allows simplified logging and reporting.
So if we request api.example.org/resources the system matches the incoming request URL to a destination URL. Makes the request to destination and receives the response, does appropriate logging and deals with any errors. Makes sense?
My question(s):
Are there any out of the box open source solutions that does this?
Which frameworks/libs etc would you suggest as a good starting point. I've looked at Goliath (Ruby) but am not limited to any language as long as it's open source and linux.
Thanks.
I've decided to go with API Umbrella.
https://github.com/NREL/api-umbrella
It provides exactly what I need. Built with Ruby, uses mongo, does routing. Perfect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With