{"id":13393590,"url":"https://github.com/syntaqx/serve","last_synced_at":"2025-10-21T04:50:46.580Z","repository":{"id":37732919,"uuid":"165146736","full_name":"syntaqx/serve","owner":"syntaqx","description":"🍽️ a static http server anywhere you need one.","archived":false,"fork":false,"pushed_at":"2025-09-08T04:03:01.000Z","size":290,"stargazers_count":347,"open_issues_count":2,"forks_count":22,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-28T03:44:36.882Z","etag":null,"topics":["cli","command","file-server","http","http-server","simple-http-server","static-server","static-site"],"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/syntaqx.png","metadata":{"funding":{"github":["syntaqx"]},"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2019-01-10T23:31:52.000Z","updated_at":"2025-09-16T16:32:38.000Z","dependencies_parsed_at":"2024-03-04T05:28:57.787Z","dependency_job_id":"e36371d8-fbd2-4227-8d26-e2a269b50e59","html_url":"https://github.com/syntaqx/serve","commit_stats":{"total_commits":123,"total_committers":6,"mean_commits":20.5,"dds":"0.13008130081300817","last_synced_commit":"f5bcf81161cc897156f34abefbdb12cc46984fbe"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/syntaqx/serve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaqx%2Fserve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaqx%2Fserve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaqx%2Fserve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaqx%2Fserve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntaqx","download_url":"https://codeload.github.com/syntaqx/serve/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntaqx%2Fserve/sbom","scorecard":{"id":351052,"data":{"date":"2025-08-11","repo":{"name":"github.com/syntaqx/serve","commit":"1906104fbe220d057e041a05b30a14dca9de12a5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 1/3 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/dependabot.yml:7","Warn: no topLevel permission defined: .github/workflows/docker.yml:1","Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/golangci-lint.yml:11","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/syntaqx/.github/SECURITY.md:1","Info: Found linked content: github.com/syntaqx/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/syntaqx/.github/SECURITY.md:1","Info: Found text in security policy: github.com/syntaqx/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/codeql.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dependabot.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/dependabot.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docker.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/docker.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/docker.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/go.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/golangci-lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/golangci-lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/syntaqx/serve/golangci-lint.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:19: pin your Docker image by updating alpine to alpine@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   9 third-party GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned","Info:   1 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.5.0 not signed: https://api.github.com/repos/syntaqx/serve/releases/28207036","Warn: release artifact v0.4.0 not signed: https://api.github.com/repos/syntaqx/serve/releases/16381140","Warn: release artifact v0.3.0 not signed: https://api.github.com/repos/syntaqx/serve/releases/15247434","Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/syntaqx/serve/releases/15029549","Warn: release artifact v0.1.0 not signed: https://api.github.com/repos/syntaqx/serve/releases/14976601","Warn: release artifact v0.5.0 does not have provenance: https://api.github.com/repos/syntaqx/serve/releases/28207036","Warn: release artifact v0.4.0 does not have provenance: https://api.github.com/repos/syntaqx/serve/releases/16381140","Warn: release artifact v0.3.0 does not have provenance: https://api.github.com/repos/syntaqx/serve/releases/15247434","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/syntaqx/serve/releases/15029549","Warn: release artifact v0.1.0 does not have provenance: https://api.github.com/repos/syntaqx/serve/releases/14976601"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 4 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T08:18:48.658Z","repository_id":37732919,"created_at":"2025-08-18T08:18:48.658Z","updated_at":"2025-08-18T08:18:48.658Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280207180,"owners_count":26290616,"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-10-21T02:00:06.614Z","response_time":58,"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":["cli","command","file-server","http","http-server","simple-http-server","static-server","static-site"],"created_at":"2024-07-30T17:00:56.528Z","updated_at":"2025-10-21T04:50:46.556Z","avatar_url":"https://github.com/syntaqx.png","language":"Go","funding_links":["https://github.com/sponsors/syntaqx"],"categories":["工具库","Go","公用事业公司","工具库`可以提升效率的通用代码库和工具`","Utilities","Utility"],"sub_categories":["查询语","实用程序/Miscellaneous","Utility/Miscellaneous","HTTP Clients","Fail injection"],"readme":"# \u003cimg src=\"https://raw.githubusercontent.com/syntaqx/serve/main/docs/logo.svg?sanitize=true\" width=\"250\"\u003e\n\n`serve` is a static http server anywhere you need one.\n\n[homebrew]:   https://brew.sh/\n[git]:        https://git-scm.com/\n[golang]:     https://golang.org/\n[releases]:   https://github.com/syntaqx/serve/releases\n[modules]:    https://github.com/golang/go/wiki/Modules\n[docker-hub]: https://hub.docker.com/r/syntaqx/serve\n\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n[![codecov](https://codecov.io/gh/syntaqx/serve/branch/main/graph/badge.svg?token=FGkU1ntp8z)](https://codecov.io/gh/syntaqx/serve)\n[![Go Report Card](https://goreportcard.com/badge/github.com/syntaqx/serve)](https://goreportcard.com/report/github.com/syntaqx/serve)\n[![Go Reference](https://pkg.go.dev/badge/github.com/syntaqx/serve.svg)](https://pkg.go.dev/github.com/syntaqx/serve)\n\n[![GitHub Release](https://img.shields.io/github/release-pre/syntaqx/serve.svg)][releases]\n[![Docker Pulls](https://img.shields.io/docker/pulls/syntaqx/serve.svg)][docker-hub]\n\n\u003e 🚨 The `main` branch is currently in active R\u0026D for the next release of `serve`.\n\u003e To use `serve`, please be sure to download a previous [release](https://github.com/syntaqx/serve/releases) as no stability guarantees\n\u003e are being made further progress has been made towards a release candidate.\n\n## TL;DR\n\n\u003e It's basically `python -m SimpleHTTPServer 8080` written in Go, because who\n\u003e can remember that many letters?\n\n### Features\n\n* HTTPS (TLS)\n* CORS support\n* Request logging\n* `net/http` compatible\n* Support for [BasicAuth](https://en.wikipedia.org/wiki/Basic_access_authentication) via `users.json`\n\n## Installation\n\n`serve` can be installed in a handful of ways:\n\n### Homebrew on macOS\n\nIf you are using [Homebrew][] on macOS, you can install `serve` with the\nfollowing command:\n\n```sh\nbrew install syntaqx/tap/serve\n```\n\n### Docker\n\nThe official [syntaqx/serve][docker-hub] image is available on Docker Hub.\n\nTo get started, try hosting a directory from your docker host:\n\n```sh\ndocker run -v .:/var/www:ro -d syntaqx/serve\n```\n\nAlternatively, a simple `Dockerfile` can be used to generate a new image that\nincludes the necessary content:\n\n```dockerfile\nFROM syntaqx/serve\nCOPY . /var/www\n```\n\nPlace this in the same directory as your content, then `build` and `run` the\ncontainer:\n\n```sh\ndocker build -t some-content-serve .\ndocker run --name some-serve -d some-content-serve\n```\n\n#### Exposing an external port\n\n```sh\ndocker run --name some-serve -d -p 8080:8080 some-content-serve\n```\n\nThen you can navigate to http://localhost:8080/ or http://host-ip:8080/ in your\nbrowser.\n\n#### Using environment variables for configuration\n\n[12-factor-config]: https://12factor.net/config\n\nCurrently, `serve` only supports using the `PORT` environment variable for\nsetting the listening port. All other configurations are available as CLI flags.\n\n\u003e In future releases, most configurations will be settable from both the CLI\n\u003e flag as well as a compatible environment variable, aligning with the\n\u003e expectations of a [12factor app][12-factor-config]. But, that will require a\n\u003e fair amount of work before the functionality is made available.\n\nHere's an example using `compose.yml` to configure `serve` to use HTTPS:\n\n```yaml\nversion: '3'\nservices:\n  web:\n    image: syntaqx/serve\n    volumes:\n      - ./static:/var/www\n      - ./fixtures:/etc/ssl\n    environment:\n      - PORT=1234\n    ports:\n      - 1234\n    command: serve -ssl -cert=/etc/ssl/cert.pem -key=/etc/ssl/key.pem -dir=/var/www\n```\n\nThe project repository provides an example [compose](./compose.yml) that\nimplements a variety of common use-cases for `serve`. Feel free to use those to\nhelp you get started.\n\n### Download the binary\n\nQuickly download install the latest release:\n\n```sh\ncurl -sfL https://install.goreleaser.com/github.com/syntaqx/serve.sh | sh\n```\n\nOr manually download the [latest release][releases] binary for your system and\narchitecture and install it into your `$PATH`.\n\n### From source\n\nTo build from source, check out the instructions on getting started with\n[development](#development).\n\n## Usage\n\n```sh\nserve [options] [path]\n```\n\n\u003e `[path]` defaults to `.` (relative path to the current directory)\n\nThen simply open your browser to http://localhost:8080 to view your server.\n\n### Options\n\nThe following configuration options are available:\n\n* `--host` host address to bind to (defaults to `0.0.0.0`)\n* `--port` listening port (defaults to `8080`)\n* `--ssl` enable https (defaults to `false`)\n* `--cert` path to the ssl cert file (defaults to `cert.pem`)\n* `--key` path to the ssl key file (defaults to `key.pem`)\n* `--dir` directory path to serve (defaults to `.`, also configurable by `arg[0]`)\n* `--users` path to users file (defaults to `users.dat`); file should contain lines of username:password in plain text\n\n## Development\n\nTo develop `serve` or interact with its source code in any meaningful way, be\nsure you have the following installed:\n\n### Prerequisites\n\n* [Git][git]\n* [Go][golang]\n\n### Install\n\nYou can download and install the project from GitHub by simply running:\n\n```sh\ngit clone git@github.com:syntaqx/serve.git \u0026\u0026 cd $(basename $_ .git)\nmake install\n```\n\nThis will install `serve` into your `$GOPATH/bin` directory, which assuming is\nproperly appended to your `$PATH`, can now be used:\n\n```sh\n$ serve version\nserve version v0.0.6-8-g5074d63 windows/amd64\n```\n\n## Using `serve` manually\n\nBesides running `serve` using the provided binary, you can also embed a\n`serve.FileServer` into your own Go program:\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"net/http\"\n\n    \"github.com/syntaqx/serve\"\n)\n\nfunc main() {\n    fs := serve.NewFileServer()\n    log.Fatal(http.ListenAndServe(\":8080\", fs))\n}\n```\n\n## License\n\n[MIT]: https://opensource.org/licenses/MIT\n\n`serve` is open source software released under the [MIT license][MIT].\n\nAs with all Docker images, these likely also contain other software which may be\nunder other licenses (such as Bash, etc from the base distribution, along with\nany direct or indirect dependencies of the primary software being contained).\n\nAs for any pre-built image usage, it is the image user's responsibility to\nensure that any use of this image complies with any relevant licenses for all\nsoftware contained within.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaqx%2Fserve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntaqx%2Fserve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntaqx%2Fserve/lists"}