{"id":19208625,"url":"https://github.com/heiwa4126/sam-http-api1","last_synced_at":"2025-07-11T01:37:21.777Z","repository":{"id":111910879,"uuid":"539813494","full_name":"heiwa4126/sam-http-api1","owner":"heiwa4126","description":"AWS API Gateway の HTTP API の最小サンプルを AWS SAMで","archived":false,"fork":false,"pushed_at":"2022-09-22T05:40:52.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T16:18:45.230Z","etag":null,"topics":["aws-gateway-api","aws-sam","example"],"latest_commit_sha":null,"homepage":"","language":"Python","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/heiwa4126.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":"2022-09-22T05:28:02.000Z","updated_at":"2022-09-22T05:29:50.000Z","dependencies_parsed_at":"2023-04-07T22:16:19.754Z","dependency_job_id":null,"html_url":"https://github.com/heiwa4126/sam-http-api1","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fsam-http-api1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fsam-http-api1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fsam-http-api1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heiwa4126%2Fsam-http-api1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heiwa4126","download_url":"https://codeload.github.com/heiwa4126/sam-http-api1/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240280984,"owners_count":19776418,"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":["aws-gateway-api","aws-sam","example"],"created_at":"2024-11-09T13:27:12.557Z","updated_at":"2025-02-23T07:16:32.033Z","avatar_url":"https://github.com/heiwa4126.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sam-http-api1\n\nAWS API GatewayのHTTP APIの最小サンプルを AWS SAMで。\n\nもとはSAMのhello worldテンプレートで(Python 3.9)、\n変更したのは\n\n- AWS::Serverless::Function の Events の Type を Api から HttpApi へ変更\n- Outputs の HelloWorldApi の\n  - ServerlessRestApi を ServerlessHttpApi へ変更\n  - /Prod を削除 (ステージがデフォルト1個しかないみたい)。\n  - 最後の/を削除\n\n# デプロイ\n\nデプロイは普通に\n`sam build \u0026\u0026 sam deploy --guided`\nで。\n\n```\nHelloWorldFunction may not have authorization defined, Is this okay? [y/N]:\n```\n\nだけ `y`で(次のバージョンでJWTオーソライザーをつける予定)、\n他はデフォルトで。\n\n\n# 注意点\n\nHTTP APIをサポートしていないリージョンがある(大阪とか)。\n\nAWSコンソールのスタックのリソースの AWS::ApiGatewayV2::Api からのリンクが壊れている。\nLambdaのほうから回れば行ける。\n\nレスポンスのContent-Typeが text/plain 。REST APIのほうはMIMEがJSONだったような気がする。\n\n\n\n# 参考リンク\n\n- [AWS::Serverless::HttpApi - AWS Serverless Application Model](https://docs.aws.amazon.com/ja_jp/serverless-application-model/latest/developerguide/sam-resource-httpapi.html#sam-resource-httpapi-return-values)\n- [REST API と HTTP API 間で選択する - Amazon API Gateway](https://docs.aws.amazon.com/ja_jp/apigateway/latest/developerguide/http-api-vs-rest.html)\n- [AWS SAMでHTTP APIを実装する。CORSも設定する。REST APIと微妙に違う！ - Fusic Tech Blog](https://tech.fusic.co.jp/posts/2021-12-10-http-api-cors/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiwa4126%2Fsam-http-api1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheiwa4126%2Fsam-http-api1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheiwa4126%2Fsam-http-api1/lists"}