{"id":18938038,"url":"https://github.com/adityaaw/go-rest-api","last_synced_at":"2025-04-15T19:30:20.513Z","repository":{"id":61625904,"uuid":"390592807","full_name":"adityaaw/go-rest-api","owner":"adityaaw","description":"A simple Go based REST API server built using gorilla/mux HTTP router and PostgreSQL database.","archived":false,"fork":false,"pushed_at":"2024-01-11T21:30:16.000Z","size":11,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T15:42:54.651Z","etag":null,"topics":["go","go-rest-api","golang","golang-examples","rest-api","restful-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adityaaw.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":"2021-07-29T03:48:51.000Z","updated_at":"2025-04-11T22:15:27.000Z","dependencies_parsed_at":"2024-06-20T02:58:13.235Z","dependency_job_id":"7107faf9-bb98-4866-81b6-f6bf871bfe9d","html_url":"https://github.com/adityaaw/go-rest-api","commit_stats":null,"previous_names":["adityaaw/go-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityaaw%2Fgo-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityaaw%2Fgo-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityaaw%2Fgo-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityaaw%2Fgo-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityaaw","download_url":"https://codeload.github.com/adityaaw/go-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249138481,"owners_count":21218894,"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":["go","go-rest-api","golang","golang-examples","rest-api","restful-api"],"created_at":"2024-11-08T12:13:16.360Z","updated_at":"2025-04-15T19:30:20.267Z","avatar_url":"https://github.com/adityaaw.png","language":"Go","readme":"# go-rest-api\nA simple Go based REST API server built using [gorilla/mux](https://github.com/gorilla/mux) HTTP router and [PostgreSQL](https://www.postgresql.org/) database.\n\n### Prerequisites\n-----------------\n - Basic familiarity with Go and PostgreSQL, and\n - That you have working [Go](https://golang.org/) and [Docker](https://docs.docker.com/get-docker/) installations. You can use Docker to run a test database easily.\n\n### Run locally\n---------------\n - Start PostgreSQL container using:\n    ```bash\n    $ ./run.sh startdb\n    ```\n - Once started, initialize database using:\n    ```bash\n    $ ./run.sh initdb products_db\n    ```\n - Once initialized, start server using:\n    ```bash\n    $ ./run.sh server -port=\u003cport_number\u003e # default: 8010\n    ```\n - Once started, you'll see a message like this:\n    ```bash\n    Go REST api-server listening on port: 8010\n    Press Cmd+C / Ctrl+C to stop.\n    ```\n - Now launch your browser and go to `http://localhost:8010/api/products`\n - Once done, stop PostgreSQL container using:\n    ```bash\n    $ ./run.sh stopdb\n    ```\n - To clean-up database, use:\n    ```bash\n    $ ./run.sh cleanup\n    ```\n\n### Test\n--------\nTo run unit tests, start PostgreSQL container then do:\n```bash\n$ ./run.sh test\n\n=== RUN   TestEmptyTable\n--- PASS: TestEmptyTable (0.01s)\n=== RUN   TestGetNonExistentProduct\n--- PASS: TestGetNonExistentProduct (0.00s)\n=== RUN   TestCreateProduct\n--- PASS: TestCreateProduct (0.01s)\n=== RUN   TestGetProduct\n--- PASS: TestGetProduct (0.01s)\n=== RUN   TestUpdateProduct\n--- PASS: TestUpdateProduct (0.02s)\n=== RUN   TestDeleteProduct\n--- PASS: TestDeleteProduct (0.02s)\nPASS\nok  \tgithub.com/adwardstark/go-rest-api/app\t0.604s\n```\n\n### Endpoints\n-------------\nYou can use [Postman](https://www.postman.com/) to perform CURD operations using following endpoints:\n - GET `/api/products`\n - POST `/api/product`\n - GET `/api/product/{id}`\n - PUT `/api/product/{id}`\n - DELETE `/api/product/{id}`\n\n### License\n-----------\nApache 2.0. See the [LICENSE](https://github.com/adwardstark/go-rest-api/blob/master/LICENSE) file for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityaaw%2Fgo-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityaaw%2Fgo-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityaaw%2Fgo-rest-api/lists"}