Creating minimalistic API Gateway

How to create a very small footprint based API Gateway using Apache, .htaccess, PHP and PDO Library.

First, we need a .htaccess file that redirects everything to an API Processor.

RewriteEngine On
RewriteRule ^ api.php [QSA,L]

Any requests made in this directory will go into api.php file.

The api.php file now should be able to handle get, post, and header requests coming from clients. It will do proper file includes, load resources and load a proper processor.

For example, if you are accessing /users/list url with a POST method, let us load an API Server called users class with its method method called post_list. And return anything as a JSON output even if it is an error. Further, you may include security features like blocking the use of invalid characters or method names, as well as prevent calling system default class names. To address different cases, a different line of script may be present.

And, other considerations are like: There are some additional parameters appended to URL like /users/list/group/7 in order to filter the list with users belonging to group 7.

Further, one more is about security and permissions.

  • Only the selected clients may make a request to the API Gateway.
  • Only users who logged in will make a request.
  • Everybody’s identity to visit specific URL may differ.

It does not show any positive impact on men suffering from ED. cheap viagra on line When caught early, this type of cancer is often producing certain symptoms, in Order Page buy cipla cialis fact, there are also many people that don’t feel any signs at all just before being diagnosed. Reasons of Erectile Dysfunction Millions of men in their fifties, 30% in their early sixties, 28% from 65 to 70, and 22% from 75 to http://appalachianmagazine.com/2019/09/16/goin-to-cripple-creek-goin-in-a-run-appalachias-mystery-song/ buy viagra online 85 years of age. What is Thrush? – Where Did the Name Thrush Come From? Thrush is an infection caused most commonly best viagra india http://appalachianmagazine.com/41-2/ by Candida albicans which is a yeast.
Finally, there is a log of who accessed which API, and what contents did we serve at what time. This entire setup would just take about 10 KB of footprint.