{"id":15690347,"url":"https://github.com/halkyon/go-rest-server","last_synced_at":"2025-03-30T12:16:39.576Z","repository":{"id":139897032,"uuid":"267242422","full_name":"halkyon/go-rest-server","owner":"halkyon","description":"A simple HTTP server written in Go using a RESTful style API to interact with it.","archived":false,"fork":false,"pushed_at":"2020-07-04T05:51:07.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T02:28:29.414Z","etag":null,"topics":["api","go","rest","server"],"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/halkyon.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":"2020-05-27T06:46:51.000Z","updated_at":"2020-07-04T05:51:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ba326ea-cbe8-47d1-8ea6-63582b7886b3","html_url":"https://github.com/halkyon/go-rest-server","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/halkyon%2Fgo-rest-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halkyon%2Fgo-rest-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halkyon%2Fgo-rest-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halkyon%2Fgo-rest-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halkyon","download_url":"https://codeload.github.com/halkyon/go-rest-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314149,"owners_count":20757463,"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":["api","go","rest","server"],"created_at":"2024-10-03T18:08:48.995Z","updated_at":"2025-03-30T12:16:39.551Z","avatar_url":"https://github.com/halkyon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-rest-server\n\n## What is this?\n\nA simple HTTP server written in Go using a RESTful style API to interact with it.\n\nIt doesn't do much, just demonstrates the layout of an Go HTTP server, and might be a good starting point.\n\n## Features\n\n* Uses [Gorilla web toolkit](https://www.gorillatoolkit.org) for routing, and [middleware](https://pkg.go.dev/github.com/gorilla/handlers) for logging requests.\n* `POST` body is limited using `http.MaxBytesReader`, so the server isn't overloaded from malicious requests.\n* Configurable options for address, port, timeouts, max body size, and [performance debugging](https://golang.org/pkg/net/http/pprof/).\n\n## Usage\n\n### Starting the server\n\nUsing [`docker-compose`](https://docs.docker.com/compose/):\n\n    docker-compose up -d\n\nAlternatively, you can run `make build` which places binaries for Linux, macOS, and Windows in the `build` directory.\n\nRun the resulting binaries directly with `-h` to see command line options!\n\n### Example API usage\n\nView data by `GET`ing the index route `/`:\n\n    curl http://localhost:8000\n\nCreate some data by `POST`ing to the `resource` route:\n\n    curl http://localhost:8000/resource -d '{\"Name\":\"Bob\"}' -H \"Content-Type: application/json\"\n\nView data by `GET`ing the `resource/{id}` route:\n\n    curl http://localhost:8000/resource/1\n\n## What now?\n\nThere's a lot more to be added to make this a real application! Here's a few examples:\n\n* Access data from a database, or some other pluggable source (e.g. for testing)\n* Check for data, output HTTP status not found if missing\n* Add support for DELETE requests\n* Authentication\n* Versioned API, e.g. https://mysite.com/v1/resource/1\n* Use some kind of standard specification, e.g. [OpenAPI](https://swagger.io/specification/) or [JSON API](https://jsonapi.org/)\n* Validate POST data matches expectations, e.g. correct fields provided\n* Tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalkyon%2Fgo-rest-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalkyon%2Fgo-rest-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalkyon%2Fgo-rest-server/lists"}