{"id":17124928,"url":"https://github.com/shellyln/go-single-bin-static-web-server","last_synced_at":"2025-07-27T23:35:25.118Z","repository":{"id":186168453,"uuid":"615556629","full_name":"shellyln/go-single-bin-static-web-server","owner":"shellyln","description":"Template for a single-binary web server written in Go","archived":false,"fork":false,"pushed_at":"2023-03-23T11:00:57.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T03:34:34.645Z","etag":null,"topics":["go","golang","http-server","httpd","reverse-proxy","single-binary","static-site","static-website","webserver"],"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/shellyln.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-03-18T01:34:17.000Z","updated_at":"2025-01-30T07:45:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"6712ffc5-8e49-47f6-b48f-d89eac9a34d4","html_url":"https://github.com/shellyln/go-single-bin-static-web-server","commit_stats":null,"previous_names":["shellyln/go-single-bin-static-web-server"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/shellyln/go-single-bin-static-web-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-single-bin-static-web-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-single-bin-static-web-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-single-bin-static-web-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-single-bin-static-web-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellyln","download_url":"https://codeload.github.com/shellyln/go-single-bin-static-web-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellyln%2Fgo-single-bin-static-web-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267441460,"owners_count":24087772,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"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":["go","golang","http-server","httpd","reverse-proxy","single-binary","static-site","static-website","webserver"],"created_at":"2024-10-14T18:43:42.791Z","updated_at":"2025-07-27T23:35:25.087Z","avatar_url":"https://github.com/shellyln.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-single-bin-static-web-server\n\nThis is a template for a single-binary web server written in Go.  \nAll content is embedded in the binary of the executable file.\nSimply deploying one executable file will make it work as a web server.\n\nYou can fork this project, store your content in the folder for static content,\ncommit, build, and deploy it.\n\n\n## Usage\n\n```bash\n# Clone this repo\ngit clone https://github.com/shellyln/go-single-bin-static-web-server.git\ncd go-single-bin-static-web-server\n\n# Create a fork on GitHub on your account and change remote\ngh repo fork --remote=true --fork-name my-server\n\n# Fix module name\nvi go.mod\ncat go.mod\n\u003e module github.com/your-name/my-server\n\u003e go 1.18\n\n# Setup your contents\nvi static/index.html\n\n# Commit changes\ngit commit -m \"Edit something\"\ngit push\n\n# and build executable\nmake\n\n# Run (port 8080)\n./myhttpd\n\n# Run (port 3000)\nenv PORT=3000 ./myhttpd\n\n# If you want to use with docker, build a docker image\nmake docker\n\n# and run\ndocker compose up\n```\n\n### Init script for OpenWrt\n\n```bash\ncp myhttpd /root/bin/.\nchmod 711 /root/bin/myhttpd\ncp initd/openwrt/etc/init.d/myhttpd /etc/init.d/.\nchmod 755 /etc/init.d/myhttpd\n\n/etc/init.d/myhttpd enable\n/etc/init.d/myhttpd start\n/etc/init.d/myhttpd stop\n/etc/init.d/myhttpd disable\n```\n\n### Init script for Systemd\n\n```bash\ncp myhttpd /usr/local/bin/.\nchmod 711 /usr/local/bin/myhttpd\ncp initd/systemd/etc/default/myhttpd /etc/default/.\nchmod 644 /etc/default/myhttpd\ncp initd/systemd/etc/systemd/system/myhttpd.service /etc/systemd/system/.\nchmod 644 /etc/systemd/system/myhttpd.service\n\nsystemctl enable myhttpd\nsystemctl start myhttpd\nsystemctl stop myhttpd\nsystemctl disable myhttpd\n```\n\n## Features\n\n* Serve static contents\n    * Place contents in `static/`\n    * Edit `mimetypes.json` to add custom content types\n* Reverse proxy\n    * Edit `revproxies.json`\n      ```json\n      [{\n          \"scheme\": \"http\",\n          \"host\": \"127.0.0.1:3001\",\n          \"path\": \"/api/v1/\",\n          \"reqHeaders\": {\n              \"X-Proxy-Req-Header\": \"hello\"\n          },\n          \"resHeaders\": {\n              \"X-Proxy-Res-Header\": \"world\"\n          }\n      }, {\n          \"scheme\": \"http\",\n          \"host\": \"127.0.0.1:3002\",\n          \"path\": \"/api/v2/\",\n          \"reqHeaders\": {\n              \"X-Proxy-Req-Header\": \"hello\"\n          },\n          \"resHeaders\": {\n              \"X-Proxy-Res-Header\": \"world\"\n          }\n      }]\n      ```\n\n## License\n\nMIT  \nCopyright (c) 2023 Shellyl_N and Authors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellyln%2Fgo-single-bin-static-web-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellyln%2Fgo-single-bin-static-web-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellyln%2Fgo-single-bin-static-web-server/lists"}