Skip to content

shamilnabi/simple-api-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Proxy Container

A lightweight Dockerized proxy to forward local API requests to an external API server.

This proxy allows local applications to make requests to an external API as if it were a local service. It forwards all requests, handles headers, and bypasses SSL verification for internal certificates.

Requirements

  • Docker
  • Node.js (only for local debugging)

Start the API Proxy

  1. Build the Docker image:
    docker build --no-cache --tag simple-api-proxy .
  2. Run the container on port 8080, setting BASE_HOST env variable.:
    docker run --rm -p 8080:8080 -e BASE_HOST=jsonplaceholder.typicode.com simple-api-proxy
    The proxy will listen on http://localhost:8080

Consume

Once the proxy is running, make requests to an externel API via the proxy:

curl http://localhost:8080/todos/1

or in a client application:

fetch('http://localhost:8080/todos/1')
  .then(response => response.json())
  .then(data => console.log(data));

About

A lightweight Dockerized proxy to forward local API requests to an external API server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published