{"id":34956822,"url":"https://github.com/iamatypeofwalrus/shim","last_synced_at":"2026-03-16T11:37:45.949Z","repository":{"id":92631792,"uuid":"117633023","full_name":"iamatypeofwalrus/shim","owner":"iamatypeofwalrus","description":"HTTP Handler shim for Go projects running on AWS Lambda","archived":false,"fork":false,"pushed_at":"2024-04-09T17:49:54.000Z","size":93,"stargazers_count":64,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T14:26:27.876Z","etag":null,"topics":["api-gateway","aws-lambda","golang","lambda","router","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/iamatypeofwalrus.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-16T04:54:04.000Z","updated_at":"2024-04-04T23:34:12.000Z","dependencies_parsed_at":"2024-06-21T13:10:07.074Z","dependency_job_id":"1b30e664-7903-4bf6-bad2-144985351aba","html_url":"https://github.com/iamatypeofwalrus/shim","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/iamatypeofwalrus/shim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fshim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fshim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fshim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fshim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamatypeofwalrus","download_url":"https://codeload.github.com/iamatypeofwalrus/shim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamatypeofwalrus%2Fshim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28062478,"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-12-26T02:00:06.189Z","response_time":55,"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":["api-gateway","aws-lambda","golang","lambda","router","serverless"],"created_at":"2025-12-26T22:17:44.512Z","updated_at":"2025-12-26T22:17:44.956Z","avatar_url":"https://github.com/iamatypeofwalrus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoib0UxQzQ0NXV5R0NhUUpMZHV0dmU4WS9yNG43Ynlvb3Y2WmdNZUhQYWEzMXdkMjJCNFgvUkJvSlY5aEZ6R0wyUi9Ud1B1Vll0R2FIQytpdGU3QllDUFE0PSIsIml2UGFyYW1ldGVyU3BlYyI6IlNDdzM1NmY0ZU5SWjV2aE4iLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master)](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoib0UxQzQ0NXV5R0NhUUpMZHV0dmU4WS9yNG43Ynlvb3Y2WmdNZUhQYWEzMXdkMjJCNFgvUkJvSlY5aEZ6R0wyUi9Ud1B1Vll0R2FIQytpdGU3QllDUFE0PSIsIml2UGFyYW1ldGVyU3BlYyI6IlNDdzM1NmY0ZU5SWjV2aE4iLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master)\n[![GoDoc](https://godoc.org/github.com/iamatypeofwalrus/shim?status.svg)](https://godoc.org/github.com/iamatypeofwalrus/shim)\n[![Go Report Card](https://goreportcard.com/badge/github.com/iamatypeofwalrus/shim)](https://goreportcard.com/report/github.com/iamatypeofwalrus/shim)\n\n# Shim\nShim is a thin layer between API Gateway integration requests via Lambda and the standard library `http.Handler` interface. It allows you to write plain ol' Go and run it on Lambda with minimal modifications. Bring your own router!\n\nShim uses [Go modules](https://github.com/golang/go/wiki/Modules) to model its dependencies.\n\n## Example\nFor an extensive example on how `shim` fits in with other AWS serverless tooling like [SAM Local](https://github.com/awslabs/aws-sam-local) and the [Serverless Application Model (SAM) specification](https://github.com/awslabs/serverless-application-model) head over to the [this example in the wiki](https://github.com/iamatypeofwalrus/shim/wiki/Example:-AWS-Sam-Local)\n\n### Note: API Gateway\nMake sure that [proxy pass integration in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html) is enabled to make sure your application receives every request sent to your API Gateway endpoint.\n\n### Code\n#### With Rest API (API Gateway Proxy Request, Response)\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n\n  \"github.com/aws/aws-lambda-go/lambda\"\n\n  \"github.com/iamatypeofwalrus/shim\"\n)\n\nfunc main() {\n  // Create a router as normal. Any router that satisfies the http.Handler interface\n  // is accepted!\n  mux := http.NewServeMux()\n  mux.HandleFunc(\"/\", func(w http.ResponseWriter, req *http.Request) {\n    fmt.Fprint(w, \"hello, world\")\n  })\n\n  s := shim.HandleRestApiRequests(mux)\n\n  // Pass your router to shim and let Lambda handle the rest\n  lambda.Start(s.Handle)\n}\n```\n\n#### With HTTP API (API Gateway V2 Request, Response)\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n\n  \"github.com/aws/aws-lambda-go/lambda\"\n\n  \"github.com/iamatypeofwalrus/shim\"\n)\n\nfunc main() {\n  // Create a router as normal. Any router that satisfies the http.Handler interface\n  // is accepted!\n  mux := http.NewServeMux()\n  mux.HandleFunc(\"/\", func(w http.ResponseWriter, req *http.Request) {\n    fmt.Fprint(w, \"hello, world\")\n  })\n\n  s := shim.HandleHttpApiRequests(mux)\n\n  // Pass your router to shim and let Lambda handle the rest\n  lambda.Start(s.Handle)\n}\n```\n\n### With Debugging Logger\nYou can pull logs from various steps in the shim by passing the `SetDebugLogger` option. [It accepts any logger that provides `Printf`](https://github.com/iamatypeofwalrus/shim/blob/56bb8c10bbb8e36d964551ceace772f675141ec8/log.go#L5) functions a lá the standard library logger.\n\n```go\nfunc main() {\n  ...\n\n  l := log.New(os.Stdout, \"\", log.LstdFlags)\n  shim := shim.New(\n    nil, // or your mux\n    shim.SetDebugLogger(l)\n  )\n\n  ...\n}\n```\n\nThere is also a shim for the `slog` package\n\n```go\nfunc main() {\n  ...\n\n  // Debug with Slog calls the Debug method on slog. Slog defaults to INFO, so it needs to be set to Debug so you can see the messages\n  logger := slog.New(slog.NewJSONHandler(os.Stdout, \u0026slog.HandlerOptions{Level: slog.LevelDebug}))\n  shim := shim.New(\n    nil, // or your mux\n    shim.SetDebugWithSlog(l)\n  )\n\n  ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamatypeofwalrus%2Fshim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamatypeofwalrus%2Fshim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamatypeofwalrus%2Fshim/lists"}