{"id":24482327,"url":"https://github.com/cccaaannn/gohst","last_synced_at":"2025-03-14T19:23:02.987Z","repository":{"id":250390993,"uuid":"833842454","full_name":"cccaaannn/gohst","owner":"cccaaannn","description":"Go HTTP Server Tool","archived":false,"fork":false,"pushed_at":"2024-08-12T18:47:00.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T12:13:19.599Z","etag":null,"topics":["codecov","go","go-http-server","go-package","gohst","http","http-server","simple-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cccaaannn.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":"2024-07-25T21:49:00.000Z","updated_at":"2024-08-12T18:47:03.000Z","dependencies_parsed_at":"2024-08-12T21:29:30.739Z","dependency_job_id":"ee7b6b01-ce10-44e6-a6a2-7ea86fcde087","html_url":"https://github.com/cccaaannn/gohst","commit_stats":null,"previous_names":["cccaaannn/gohst"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cccaaannn%2Fgohst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cccaaannn%2Fgohst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cccaaannn%2Fgohst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cccaaannn%2Fgohst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cccaaannn","download_url":"https://codeload.github.com/cccaaannn/gohst/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243633142,"owners_count":20322539,"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":["codecov","go","go-http-server","go-package","gohst","http","http-server","simple-server"],"created_at":"2025-01-21T12:13:24.464Z","updated_at":"2025-03-14T19:23:02.933Z","avatar_url":"https://github.com/cccaaannn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gohst\n\n### Go HTTP Server Tool\nA simple http server\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/cccaaannn/gohst.svg)](https://pkg.go.dev/github.com/cccaaannn/gohst) [![codecov](https://codecov.io/github/cccaaannn/gohst/graph/badge.svg?token=CM770U3IB4)](https://codecov.io/github/cccaaannn/gohst) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/cccaaannn/gohst) ![GitHub top language](https://img.shields.io/github/languages/top/cccaaannn/gohst?color=008B8B\u0026style=flat-square) ![GitHub repo size](https://img.shields.io/github/repo-size/cccaaannn/gohst?color=FF6347\u0026style=flat-square) [![GitHub](https://img.shields.io/github/license/cccaaannn/gohst?color=green\u0026style=flat-square)](https://github.com/cccaaannn/gohst/blob/master/LICENSE)\n\n---\n\n## Features\n\n1. Simple usage\n2. Path parsing\n3. TLS support\n4. Middlewares\n\n## Usage\n\n### Install package\n```shell\ngo get github.com/cccaaannn/gohst\n```\n\n### Minimal example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/cccaaannn/gohst\"\n)\n\nfunc main() {\n\tserver := gohst.CreateServer()\n\n\tserver.AddHandler(\"GET /hi/:name\", func(req *gohst.Request, res *gohst.Response) {\n\t\tname := req.Params[\"name\"]\n\t\tres.Body = fmt.Sprintf(`\n\t\t\u003cbody\u003e\n\t\t\t\u003ch1\u003eHello %s!\u003c/h1\u003e\n\t\t\u003c/body\u003e\n\t\t`, name)\n\t})\n\n\tserver.AddHandler(\"/*\", func(req *gohst.Request, res *gohst.Response) {\n\t\tres.StatusCode = 404\n\t\tres.Body = `\n\t\t\u003cbody\u003e\n\t\t\t\u003ch1\u003e404\u003c/h1\u003e\n\t\t\u003c/body\u003e\n\t\t`\n\t})\n\n\tstop, _ := server.ListenAndServe(\":8080\")\n\t\u003c-stop\n}\n\n```\n\n### Other examples\n1. [example/crud/main.go](/example/crud/main.go)\n2. [example/tls/main.go](/example/tls/main.go)\n3. [example/middleware/main.go](/example/middleware/main.go)\n\n\n## Development\n\n### Test\n```shell\ngo test -v\n```\n### Coverage\n```shell\ngo test -coverprofile=coverage.out\ngo tool cover -html=coverage.out\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcccaaannn%2Fgohst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcccaaannn%2Fgohst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcccaaannn%2Fgohst/lists"}