{"id":15630746,"url":"https://github.com/sgreben/http-file-server","last_synced_at":"2025-04-10T04:59:24.930Z","repository":{"id":46247084,"uuid":"157460780","full_name":"sgreben/http-file-server","owner":"sgreben","description":"tiny portable HTTP file server. single binary, no dependencies. linux, osx, windows. #golang","archived":false,"fork":false,"pushed_at":"2023-01-13T19:11:47.000Z","size":413,"stargazers_count":223,"open_issues_count":7,"forks_count":38,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-03T01:11:09.199Z","etag":null,"topics":["golang","http-server","self-contained","tar-gz","tiny","zip"],"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/sgreben.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}},"created_at":"2018-11-13T23:25:30.000Z","updated_at":"2025-04-02T14:29:06.000Z","dependencies_parsed_at":"2023-02-09T16:46:29.500Z","dependency_job_id":null,"html_url":"https://github.com/sgreben/http-file-server","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgreben%2Fhttp-file-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgreben%2Fhttp-file-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgreben%2Fhttp-file-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgreben%2Fhttp-file-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgreben","download_url":"https://codeload.github.com/sgreben/http-file-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161266,"owners_count":21057554,"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":["golang","http-server","self-contained","tar-gz","tiny","zip"],"created_at":"2024-10-03T10:36:14.282Z","updated_at":"2025-04-10T04:59:24.907Z","avatar_url":"https://github.com/sgreben.png","language":"Go","readme":"# http-file-server\n\n`http-file-server` is a dependency-free HTTP file server. Beyond directory listings and file downloads, it lets you download a whole directory as as `.zip` or `.tar.gz` (generated on-the-fly).\n\n![screenshot](doc/screenshot.png)\n\n## Contents\n\n- [Contents](#contents)\n- [Examples](#examples)\n  - [Serving a path at `/`](#serving-a-path-at-)\n  - [Serving $PWD at `/`](#serving-pwd-at-)\n  - [Serving multiple paths, setting the HTTP port via CLI arguments](#serving-multiple-paths-setting-the-http-port-via-cli-arguments)\n  - [Setting the HTTP port via environment variables](#setting-the-http-port-via-environment-variables)\n  - [Uploading files using cURL](#uploading-files-using-curl)\n  - [HTTPS (SSL/TLS)](#https-ssltls)\n- [Get it](#get-it)\n  - [Using `go get`](#using-go-get)\n  - [Pre-built binary](#pre-built-binary)\n- [Use it](#use-it)\n\n## Examples\n\n### Serving a path at `/`\n\n```sh\n$ http-file-server /tmp\n2018/11/13 23:00:03 serving local path \"/tmp\" on \"/tmp/\"\n2018/11/13 23:00:03 redirecting to \"/tmp/\" from \"/\"\n2018/11/13 23:00:03 http-file-server listening on \":8080\"\n```\n\n### Serving $PWD at `/`\n\n```sh\n$ cd /tmp\n$ http-file-server\n2018/12/13 03:18:00 serving local path \"/tmp\" on \"/tmp/\"\n2018/12/13 03:18:00 redirecting to \"/tmp/\" from \"/\"\n2018/12/13 03:18:00 http-file-server listening on \":8080\"\n```\n\n### Serving multiple paths, setting the HTTP port via CLI arguments\n\n```sh\n$ http-file-server -p 1234 /1=/tmp /2=/var/tmp\n2018/11/13 23:01:44 serving local path \"/tmp\" on \"/1/\"\n2018/11/13 23:01:44 serving local path \"/var/tmp\" on \"/2/\"\n2018/11/13 23:01:44 redirecting to \"/1/\" from \"/\"\n2018/11/13 23:01:44 http-file-server listening on \":1234\"\n```\n\n### Setting the HTTP port via environment variables\n\n```sh\n$ export PORT=9999\n$ http-file-server /abc/def/ghi=/tmp\n2018/11/13 23:05:52 serving local path \"/tmp\" on \"/abc/def/ghi/\"\n2018/11/13 23:05:52 redirecting to \"/abc/def/ghi/\" from \"/\"\n2018/11/13 23:05:52 http-file-server listening on \":9999\"\n```\n\n### Uploading files using cURL\n\n```sh\n$ ./http-file-server -uploads /=/path/to/serve\n2020/03/10 22:00:54 serving local path \"/path/to/serve\" on \"/\"\n2020/03/10 22:00:54 http-file-server listening on \":8080\"\n```\n\n```sh\ncurl -LF \"file=@example.txt\" localhost:8080/path/to/upload/to\n```\n\n### HTTPS (SSL/TLS)\n\nTo terminate SSL at the file server, set `-ssl-cert` (`SSL_CERTIFICATE`) and `-ssl-key` (`SSL_KEY`) to the respective files' paths:\n\n```sh\n$ ./http-file-server -port 8443 -ssl-cert server.crt -ssl-key server.key\n2020/03/10 22:00:54 http-file-server (HTTPS) listening on \":8443\"\n```\n\n## Get it\n\n### Using `go get`\n\n```sh\ngo get -u github.com/sgreben/http-file-server\n```\n\n### Pre-built binary\n\nOr [download a binary](https://github.com/sgreben/http-file-server/releases/latest) from the releases page, or from the shell:\n\n```sh\n# Linux\ncurl -L https://github.com/sgreben/http-file-server/releases/download/1.6.1/http-file-server_1.6.1_linux_x86_64.tar.gz | tar xz\n\n# OS X\ncurl -L https://github.com/sgreben/http-file-server/releases/download/1.6.1/http-file-server_1.6.1_osx_x86_64.tar.gz | tar xz\n\n# Windows\ncurl -LO https://github.com/sgreben/http-file-server/releases/download/1.6.1/http-file-server_1.6.1_windows_x86_64.zip\nunzip http-file-server_1.6.1_windows_x86_64.zip\n```\n\n## Use it\n\n```text\nhttp-file-server [OPTIONS] [[ROUTE=]PATH] [[ROUTE=]PATH...]\n```\n\n```text\nUsage of http-file-server:\n  -a string\n    \t(alias for -addr) (default \":8080\")\n  -addr string\n    \taddress to listen on (environment variable \"ADDR\") (default \":8080\")\n  -p int\n    \t(alias for -port)\n  -port int\n    \tport to listen on (overrides -addr port) (environment variable \"PORT\")\n  -q\t(alias for -quiet)\n  -quiet\n    \tdisable all log output (environment variable \"QUIET\")\n  -r value\n    \t(alias for -route)\n  -route value\n    \ta route definition ROUTE=PATH (ROUTE defaults to basename of PATH if omitted)\n  -ssl-cert string\n    \tpath to SSL server certificate (environment variable \"SSL_CERTIFICATE\")\n  -ssl-key string\n    \tpath to SSL private key (environment variable \"SSL_KEY\")\n  -u\t(alias for -uploads)\n  -uploads\n    \tallow uploads (environment variable \"UPLOADS\")\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgreben%2Fhttp-file-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgreben%2Fhttp-file-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgreben%2Fhttp-file-server/lists"}