{"id":24121285,"url":"https://github.com/jojoarianto/learn-1-go-api","last_synced_at":"2026-06-16T09:31:00.536Z","repository":{"id":87507300,"uuid":"172632071","full_name":"jojoarianto/learn-1-go-api","owner":"jojoarianto","description":"Serverless + Rest Api + Go","archived":false,"fork":false,"pushed_at":"2019-02-27T05:38:08.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T21:17:52.386Z","etag":null,"topics":["golang","microservice","serverless"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/jojoarianto.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":"2019-02-26T03:35:34.000Z","updated_at":"2019-02-27T05:38:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"22e18024-f076-43f3-aaf1-8d9de75a9612","html_url":"https://github.com/jojoarianto/learn-1-go-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jojoarianto/learn-1-go-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoarianto%2Flearn-1-go-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoarianto%2Flearn-1-go-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoarianto%2Flearn-1-go-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoarianto%2Flearn-1-go-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jojoarianto","download_url":"https://codeload.github.com/jojoarianto/learn-1-go-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoarianto%2Flearn-1-go-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34400451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"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":["golang","microservice","serverless"],"created_at":"2025-01-11T10:51:29.778Z","updated_at":"2026-06-16T09:31:00.513Z","avatar_url":"https://github.com/jojoarianto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless with Golang \n\n## Prerequisites\n\n- Go 1.1x\n- Serverless Framework\n- AWS SAM CLI\n- Docker\n\n## Goal\n- [X] API to [get all user](#get-all-users)\n- [X] API to [get user by id](#get-user-by-id)\n- [x] API to [create user](#create-user) \n- [ ] API to delete user\n- [ ] API to update user\n\n## Run in local with SAM (AWS-SAM-CLI)\n\nCompile go project\n```bash\n# see Makefile\nmake build\n```\n\nRun with SAM, (required : docker, postgres)\n```bash\n# http://localhost:8000/\nsam local start-api -p 8000 --env-vars local.env.json\n```\n\n## Deployment\n\n```bash\n# set your serverless config\nserverless config credentials --provider aws --key \u003cACCESS KEY ID\u003e --secret \u003cSECRET KEY\u003e\n\n# deploy\nserverless deploy\n```\n\n## Get All Users\n\n\u003e live demo [https://0d8n48wogc.execute-api.us-east-1.amazonaws.com/dev/user](https://0d8n48wogc.execute-api.us-east-1.amazonaws.com/dev/user)\n\nRequest\n```bash\ncurl --request GET \\\n  --url https://0d8n48wogc.execute-api.us-east-1.amazonaws.com/dev/users\n```\n\nResponse\n```json\n\n  \"data\": [\n    ...\n    {\n      \"user_id\": 6,\n      \"email\": \"user_6@gmail.com\"\n    },\n    {\n      \"user_id\": 7,\n      \"email\": \"user_7@hotmail.com\"\n    },\n    ...\n  ]\n}\n```\n\n## Get User By Id\n\n\u003e live demo [https://0d8n48wogc.execute-api.us-east-1.amazonaws.com/dev/user/2](https://0d8n48wogc.execute-api.us-east-1.amazonaws.com/dev/user/2)\n\nRequest\n```bash\ncurl --request GET \\\n  --url https://0d8n48wogc.execute-api.us-east-1.amazonaws.com/dev/user/14\n```\n\nResponse\n```json\n{\n  \"data\": {\n    \"user_id\": 14,\n    \"email\": \"create-something-cool@gmail.com\"\n  }\n}\n```\n\n## Create User\nRequest\n```bash\ncurl --request POST \\\n  --url https://0d8n48wogc.execute-api.us-east-1.amazonaws.com/dev/user \\\n  --header 'content-type: application/json' \\\n  --data '{\n\t      \"email\": \"anything@gmail.com\"\n    }'\n```\n\n### References\n- Create serverless template with golang, https://serverless.com/blog/framework-example-golang-lambda-support/\n- Deploy Serverless, https://medium.com/devopslinks/aws-lambda-serverless-framework-python-part-1-a-step-by-step-hello-world-4182202aba4a\n- Run local aws-sam-cli, https://github.com/awslabs/aws-sam-cli\n- Generating fake data using SQL, https://vnegrisolo.github.io/postgresql/generate-fake-data-using-sql\n\n## Additional note\n\n### Database\n\nI use postgres, Here is instalation postgres using docker\n\n```bash\ndocker pull postgres\n\n# alpine is lite version\ndocker run -d -p 0.0.0.0:5432:5432 postgres:alpine\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojoarianto%2Flearn-1-go-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjojoarianto%2Flearn-1-go-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojoarianto%2Flearn-1-go-api/lists"}