{"id":38034648,"url":"https://github.com/ermanimer/apigateway","last_synced_at":"2026-01-16T19:48:06.136Z","repository":{"id":216858903,"uuid":"742305329","full_name":"ermanimer/apigateway","owner":"ermanimer","description":"API Gateway","archived":false,"fork":false,"pushed_at":"2024-01-14T07:19:02.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-14T14:10:51.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ermanimer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-12T07:19:43.000Z","updated_at":"2024-01-14T13:22:47.000Z","dependencies_parsed_at":"2024-01-13T09:13:44.620Z","dependency_job_id":"099721eb-2963-4f46-b8a5-e990b70189b6","html_url":"https://github.com/ermanimer/apigateway","commit_stats":null,"previous_names":["ermanimer/apigateway"],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/ermanimer/apigateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Fapigateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Fapigateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Fapigateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Fapigateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ermanimer","download_url":"https://codeload.github.com/ermanimer/apigateway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermanimer%2Fapigateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T19:48:05.331Z","updated_at":"2026-01-16T19:48:06.130Z","avatar_url":"https://github.com/ermanimer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apigateway\n\n[![Test](https://github.com/ermanimer/apigateway/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/ermanimer/apigateway/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/ermanimer/apigateway/graph/badge.svg?token=rbFp8CZIRk)](https://codecov.io/gh/ermanimer/apigateway)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ermanimer/apigateway)](https://goreportcard.com/report/github.com/ermanimer/apigateway)\n\n**apigateway** is an API gateway designed for use in development environments or sandboxes. It follows these principles in its design:\n\n - Its configuration is simple.\n - It can be used directly within Docker Compose.\n - It does not perform load balancing.\n - It does not modify requests and responses.\n - It leverages the reverse proxy provided in Go's standard library, ensuring optimal performance and efficiency.\n\n # Using with Docker Compose\n\n**docker-compose.yml**\n\n```yaml\nversion: '3'\n\nservices:\n  apigateway:\n    container_name: apigateway\n    restart: always\n    image: imererman/apigateway:latest\n    volumes:\n      - ./config.yml:/app/config.yml\n    networks:\n      - apigateway-network\n    ports:\n      - 80:8080\n    \n  service1:\n    container_name: service1\n    ...\n    networks:\n      - apigateway-network\n\nnetworks:\n  apigateway-network:\n    name: apigateway-network\n```\n\n**config.yml**\n\n```yaml\nupstreams:\n  - pattern: /service1/\n    strip_prefix: true\n    url: http://service1:8080\n```\n\nWith this configuration in docker-compose, all requests starting with the **/service1/** pattern coming to the API gateway will be forwarded to service1 after stripping the pattern. For example:\n\n```\nhttp://localhost:80/service1/health-check -\u003e http://service1/8080/health-check:\n```\n\nIf ```strip_prefix``` was ```false```, the request coming to the API gateway as above would be forwarded to service1 without stripping the pattern, as follows:\n\n```\nhttp://localhost:80/service1/health-check -\u003e http://service1/service1/8080/health-check:\n```\n\n# Configuration\n\nAs seen in the example above, only upstream configuration is sufficient. Below, the default configuration for the server is shown. If desired, the server can also be configured.\n\n```yaml\nserver:\n  address: :8080\n  read_timeout: 5s\n  write_timeout: 10s\n  idle_timeout: 120s\n  max_header_bytes: 1048576 # 1 MB\n  shutdown_timeout: 10s\n\nupstreams:\n...\n```\n\n# Build And Run\n\nTo build the project with Go, you can run the following commands in the project directory.\n\n**build:**\n\n```bash\ngo build ./cmd/apigateway\n```\n\n**run:**\n\n```bash\n./apigateway\n```\n\nNote: apigateway always looks for the config.yml file in its directory.\n\n# Contribution\n\nOpen an issue and let's collectively decide on the changes and features you want. Then, you can proceed by opening a pull request from the main branch of your forked repository to the main branch of the main repository.\n\n# License\n\nThis repo is under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermanimer%2Fapigateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fermanimer%2Fapigateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermanimer%2Fapigateway/lists"}