{"id":22462466,"url":"https://github.com/commonjava/gateway","last_synced_at":"2025-08-02T05:31:41.096Z","repository":{"id":41893917,"uuid":"311909244","full_name":"Commonjava/gateway","owner":"Commonjava","description":"API gateway.","archived":false,"fork":false,"pushed_at":"2024-10-28T02:57:49.000Z","size":329,"stargazers_count":4,"open_issues_count":2,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-28T06:28:28.317Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Commonjava.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-11T08:34:08.000Z","updated_at":"2024-10-28T02:57:51.000Z","dependencies_parsed_at":"2023-11-23T09:24:10.653Z","dependency_job_id":"d8ca2c3e-74a9-4689-9c56-e4beaed71427","html_url":"https://github.com/Commonjava/gateway","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commonjava%2Fgateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commonjava%2Fgateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commonjava%2Fgateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Commonjava%2Fgateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Commonjava","download_url":"https://codeload.github.com/Commonjava/gateway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228439518,"owners_count":17920025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-12-06T09:09:49.816Z","updated_at":"2024-12-06T09:10:44.224Z","avatar_url":"https://github.com/Commonjava.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gateway\nAPI gateway (or simply 'Gateway') is a facade to hide micro services from end users.\nIt receives HTTP requests from clients and forwards to different services.\n\nGateway determine the target service via Url patterns and HTTP methods.\nFor example, \"/api/content\" goes to indy, and \"/api/promote\" goes to promotion.\n\n## Prerequisite\n1. jdk11\n2. mvn 3.6.2+\n\n## Configure proxy services\nGateway uses a config file to define proxy rules. The configuration is in\n'proxy.yaml', e.g.,\n\n```\nproxy:\n  services:\n    - host: repo1.maven.org\n      ssl: true\n      port: 80\n      path-pattern: /maven2/.+\n```\n\nWhen receiving a HTTP request, it matches the **path and method**\nagainst the rules and relay the request to target service. If not found,\nit returns a 400 Bad Request with message body **Service not found**.\n\n## Try it!\n1. Build (make sure you use jdk11 and mvn 3.6.2+)\n```\n$ git clone git@github.com:Commonjava/gateway.git\n$ cd gateway\n$ mvn clean compile\n```\n\n2. Start gateway in debug mode\n```\n$ mvn quarkus:dev\n```\n\n3. Open another terminal and try something like,\n```\ncurl -v http://localhost:8080/maven2/org/commonjava/util/o11yphant-metrics-core/1.0/o11yphant-metrics-core-1.0.pom\n```\nOr do a maven build, e.g,\n```\n$ mvn clean install -s \u003cpath-to\u003e/settings-gateway.xml\n```\nps. The settings-gateway.xml is at the project root directory for test purpose.\n\n## Caching (Advanced)\n\nGateway provides cache for downloaded files, e.g,\n```\nproxy:\n  services:\n    - host: repo1.maven.org\n      ...\n      cache:\n        enabled: true\n        readonly: false\n        pattern: \".+\\\\.(pom|jar)(\\\\.(md5|sha.+))?$\" # only cache jar and pom files\n        expire: 2h\n        dir: /tmp/cache\n```\n\nCache config is under each service. It is optional.\n\nYou can specify arguments like expire (e.g, 1d, 2h, 3m, 30s) or pattern\n(for what files to cache). The default cache dir is \"${user_dir}/cache\"\nif not specified explicitly.\n\nThe cache is r/w-able. It writes the downloaded files to cache and render them next time.\nHowever you can specify readonly to true so that it does not write the downloaded\nfiles but rather just use whatever pre-installed in that dir.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonjava%2Fgateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommonjava%2Fgateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonjava%2Fgateway/lists"}