{"id":31787264,"url":"https://github.com/iris-contrib/gateway","last_synced_at":"2025-10-10T13:57:45.555Z","repository":{"id":57540379,"uuid":"289697504","full_name":"iris-contrib/gateway","owner":"iris-contrib","description":"Run Iris powered web applications through AWS Lambda \u0026 API Gateway","archived":false,"fork":false,"pushed_at":"2023-11-05T20:41:34.000Z","size":89,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-20T15:50:52.870Z","etag":null,"topics":["aws-iris","go","golang","iris","iris-lambda-function","iris-serverless","lambda-iris","netlify","netlify-functions","serverless"],"latest_commit_sha":null,"homepage":"","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/iris-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null},"funding":{"custom":"https://paypal.me/kataras","github":"kataras"}},"created_at":"2020-08-23T14:01:47.000Z","updated_at":"2023-09-20T14:22:30.000Z","dependencies_parsed_at":"2023-01-30T20:15:25.498Z","dependency_job_id":"549ad990-71d4-4bfd-8267-e79fc8cd30e2","html_url":"https://github.com/iris-contrib/gateway","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iris-contrib/gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fgateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fgateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fgateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fgateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iris-contrib","download_url":"https://codeload.github.com/iris-contrib/gateway/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fgateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004067,"owners_count":26083668,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["aws-iris","go","golang","iris","iris-lambda-function","iris-serverless","lambda-iris","netlify","netlify-functions","serverless"],"created_at":"2025-10-10T13:57:44.587Z","updated_at":"2025-10-10T13:57:45.537Z","avatar_url":"https://github.com/iris-contrib.png","language":"Go","readme":"# Gateway\n\n[![build status](https://img.shields.io/github/actions/workflow/status/iris-contrib/gateway/ci.yml?branch=master\u0026style=for-the-badge)](https://github.com/iris-contrib/gateway/actions) [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=for-the-badge)](https://goreportcard.com/report/github.com/iris-contrib/gateway) [![godocs](https://img.shields.io/badge/go-%20docs-488AC7.svg?style=for-the-badge)](https://pkg.go.dev/github.com/iris-contrib/gateway)\n\nGateway is a simple [iris.Runner](https://github.com/kataras/iris/blob/master/iris.go#L662). It runs Iris Web Applications through AWS Lambda \u0026 API Gateway aka **Serverless**. This includes the [Netlify functions (free and paid)](https://docs.netlify.com/functions/overview/) too. Thanks to [apex/gateway](https://github.com/apex/gateway).\n\n## Installation\n\nThe only requirement is the [Go Programming Language](https://golang.org/dl).\n\n```sh\n$ go get github.com/iris-contrib/gateway@master\n```\n\n\u003c!-- \n**Until this [PR](https://github.com/apex/gateway/pull/33) is merged, you have to use a `replace statement` inside your go.mod file**:\n\n```text\nmodule my_iris_function\n\ngo 1.15\n\nrequire (\n\tgithub.com/iris-contrib/gateway v0.0.0-20200823143335-771cd2392f72\n\tgithub.com/kataras/iris/v12 v12.2.0-alpha2\n)\n\nreplace github.com/apex/gateway/v2 v2.0.0-20200703123654-59bba3473042 =\u003e github.com/kataras/gateway/v2 v2.0.0-20200823133619-5f644b75fcd5\n```\n\nAfter 8501 minutes.... they are not quite responsible or fast enough about their open-source repos, I had to manually fork the repository and customize the code... as they don't even reply to their PRs, not just mines.\n--\u003e\n\n## Getting Started\n\nSimply as:\n\n```go\napp := iris.New()\n// [...]\n\nrunner, configurator := gateway.New(gateway.Options{})\napp.Run(runner, configurator)\n```\n\n### Netlify\n\n*1.* Create an account on [netlify.com](https://app.netlify.com/signup)\n\n*2.* Link a new website with a repository (GitHub or GitLab, public or private)\n\n*3.* Add a `main.go` in the root of that repository:\n\n```go\n// Read and Write JSON only.\npackage main\n\nfunc main() {\n    app := iris.New()\n    app.OnErrorCode(iris.StatusNotFound, notFound)\n\n    app.Get(\"/\", index)\n    app.Get(\"/ping\", status)\n\n    // IMPORTANT:\n    runner, configurator := gateway.New(gateway.Options{\n        URLPathParameter: \"path\",\n    })\n    app.Run(runner, configurator)\n}\n\nfunc notFound(ctx iris.Context){\n    code := ctx.GetStatusCode()\n    msg := iris.StatusText(code)\n    if err := ctx.GetErr(); err!=nil{\n        msg = err.Error(),\n    }\n\n    ctx.JSON(iris.Map{\n        \"Message\": msg,\n        \"Code\": code,\n    })\n}\n\nfunc index(ctx iris.Context) {\n    var req map[string]interface{}\n    ctx.ReadJSON(req)\n    ctx.JSON(req)\n}\n\nfunc status(ctx iris.Context) {\n    ctx.JSON(iris.Map{\"Message\": \"OK\"})\n}\n```\n\n*4.* Create or open the `netlify.toml` file, edit its contents so they look like the following:\n\n```tml\n[build]\n  publish = \"public\"\n  command = \"make build\"\n  functions = \"./functions\"\n  \n\n[build.environment]\n  GO_VERSION = \"1.17.2\"\n  GIMME_GO_VERSION = \"1.17.2\"\n  GO_IMPORT_PATH = \"github.com/your_username/your_repo\"\n\n[[redirects]]\n   from = \"/api/*\"\n   to = '/.netlify/functions/my_iris_function/:splat'\n   status = 200\n```\n\n**Makefile**\n\n```sh\nbuild:\n\tgo build -o ./functions/my_iris_function\n\tchmod +x ./functions/my_iris_function\n```\n\n*5.* Use `git push` to deploy to Netlify.\n\nThe serverless Iris application of will be reachable through _your_site.com/api_, e.g. `https://example.com/api?path=ping`. Have fun!\n\n## License\n\nThis software is licensed under the [MIT License](LICENSE).\n","funding_links":["https://paypal.me/kataras","https://github.com/sponsors/kataras"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firis-contrib%2Fgateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firis-contrib%2Fgateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firis-contrib%2Fgateway/lists"}