Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a routing API

Tags:

rest

ruby

soa

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.

like image 794
Johandk Avatar asked Jan 20 '26 21:01

Johandk


1 Answers

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.

like image 187
Johandk Avatar answered Jan 22 '26 14:01

Johandk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!