{"id":21319599,"url":"https://github.com/bwhtdev/go-postgres-api","last_synced_at":"2025-03-15T22:28:04.078Z","repository":{"id":190272738,"uuid":"682291943","full_name":"bwhtdev/go-postgres-api","owner":"bwhtdev","description":"Basic GO REST API with PostgresSQL","archived":false,"fork":false,"pushed_at":"2023-08-24T21:59:51.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T11:24:03.608Z","etag":null,"topics":[],"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/bwhtdev.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}},"created_at":"2023-08-23T21:25:25.000Z","updated_at":"2023-08-23T21:25:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5c18bbc-c8db-4d7e-be63-2bd4b3f054f2","html_url":"https://github.com/bwhtdev/go-postgres-api","commit_stats":null,"previous_names":["bradscottwhite/go-postgres-api","bradswhite/go-postgres-api","bwhtdev/go-postgres-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwhtdev%2Fgo-postgres-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwhtdev%2Fgo-postgres-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwhtdev%2Fgo-postgres-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwhtdev%2Fgo-postgres-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwhtdev","download_url":"https://codeload.github.com/bwhtdev/go-postgres-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243800597,"owners_count":20350038,"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":[],"created_at":"2024-11-21T19:43:06.381Z","updated_at":"2025-03-15T22:28:04.056Z","avatar_url":"https://github.com/bwhtdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-postgres-api\n\n###### To build GO app\n- `go mod init ***MOD_NAME***`\n\n[NOTE: Sometimes the version of gofiber will cause trouble]\n\n###### To deploy to railway\n- `railway init`\n- Add a Postgres DB service to app and copy env vars to .env file:\n```\nrailway add\n```\n(Only allows MySQL, Redis, and MongoDB)\n- `railway run go run app.go`\n- `railway link`\n- `railway up`\n- `railway domain`\n\n\nTo Test\nTo fetch data:\n```\ncurl https://go-postgres-api-production.up.railway.app/allbooks\n```\nTo write data:\n```\ncurl https://go-postgres-api-production.up.railway.app/addbook \\\n\t--include \\\n\t--header \"Content-Type: application/json\" \\\n\t--request \"POST\" \\\n\t--data '{\"Title\": \"First\", \"Author\": \"Brad\"}'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwhtdev%2Fgo-postgres-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwhtdev%2Fgo-postgres-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwhtdev%2Fgo-postgres-api/lists"}