Using Laravel as a service proxy/gateway

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • httpie

    🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. (by httpie)

  • the code should be pretty straighforward. for every request to /proxy/{path}, it would make a request to httpbin.org/{path} with the same HTTP method. you could try requesting the new endpoint using different methods to see it in effect. here I used HTTPie to test the endpoint:

  • httpbin

    HTTP Request & Response Service, written in Python + Flask.

  • use GuzzleHttp\Client as HttpClient; Route::any('/proxy/{path}', function(Request $req, $path) { $client = new HttpClient([ 'base_uri' => 'https://httpbin.org' ]); return $client->request($req->method(), $path); });

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts