{"id":16137395,"url":"https://github.com/purarue/subpath-serve","last_synced_at":"2026-02-04T10:47:48.366Z","repository":{"id":45407710,"uuid":"269185533","full_name":"purarue/subpath-serve","owner":"purarue","description":"a basic webserver to serve text files from a directory by matching subpaths","archived":false,"fork":false,"pushed_at":"2024-10-27T20:22:47.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T05:04:41.048Z","etag":null,"topics":["dotfiles","filesystem","server"],"latest_commit_sha":null,"homepage":"https://purarue.xyz/d/?dark","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/purarue.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":"2020-06-03T20:16:15.000Z","updated_at":"2024-10-28T03:34:40.000Z","dependencies_parsed_at":"2023-10-05T03:07:00.897Z","dependency_job_id":"bdd0bc40-0fec-4c43-9427-04024f656200","html_url":"https://github.com/purarue/subpath-serve","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"8bdf65195026d740cb049b3e1f0cffe6da8f52c3"},"previous_names":["seanbreckenridge/subpath-serve"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fsubpath-serve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fsubpath-serve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fsubpath-serve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fsubpath-serve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purarue","download_url":"https://codeload.github.com/purarue/subpath-serve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"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":["dotfiles","filesystem","server"],"created_at":"2024-10-09T23:26:47.441Z","updated_at":"2026-02-04T10:47:48.334Z","avatar_url":"https://github.com/purarue.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# subpath-serve\n\nA small server used to serve text files from my [dotfiles](https://github.com/purarue/dotfiles) (though it could be used to serve any text files/folder).\n\nAny request to `/...` tries to match against some file basepath from a root folder (defaults to `./serve`).\n\nA request to the base path (`/`) without anything else returns a newline delimited list of everything in the `./serve` folder.\n\nDoes not build an index at build/initial server start, so the `./serve` folder can be modified while the server is running to change results; each request searches the folder for the query.\n\nAppending `?dark` to the end of a URL converts a request to an HTML response with a dark theme, and converts the index to link to each page.\n\nAppending `?redirect` to the end of the URL redirects to the corresponding `-git-http-prefix`, e.g.:\n\n`.gitignore?redirect` -\u003e \u003chttps://github.com/purarue/dotfiles/blob/master/.gitignore\u003e\n\nExample Requests:\n\n- \u003chttps://purarue.xyz/d/\u003e\n- \u003chttps://purarue.xyz/d/rc.conf\u003e\n- \u003chttps://purarue.xyz/d/rc.conf?dark\u003e\n\n### matching strategy\n\nAn example of how this matches. If the files in `./serve` are:\n\n```\n./folder1/a\n./folder2/a\n./folder3/b\n```\n\n| Request to | Resolves to |\n| ---------- | ----------- |\n| /a         | ./folder1/a |\n| /b         | ./folder3/b |\n| /folder2/a | ./folder2/a |\n\nIt matches `./folder1/a` just because that's the one it found first, if there's a possibility of a conflict, its better to provide a unique subpath.\n\n### Run\n\n```sh\nusage: subpath-serve [FLAG...]\nFor instructions, see https://github.com/purarue/subpath-serve\n\n  -folder string\n    \tpath to serve subpath-serve on (default \"./serve\")\n  -git-http-prefix string\n    \tOptionally, provide a prefix which when the matched filepath is appended to, links to a git web view (e.g. https://github.com/purarue/dotfiles/blob/master)\n  -port int\n    \tport to serve subpath-serve on (default 8050)\n```\n\nAs an example, you can use my dotfiles:\n\n```\ngit clone \"https://github.com/purarue/dotfiles.git\" \"./serve\"\nsubpath-serve\n```\n\n```\ncurl localhost:8050/rc.conf\n```\n\nThe response contains the `X-Filepath` header, which includes the full path to the matched file.\n\n### Install\n\nInstall `golang`.\n\nYou can clone and run `go build`, or:\n\n```\ngo install -v \"github.com/purarue/subpath-serve@latest\"\n```\n\nwhich downloads, builds and puts the binary on your `$GOBIN`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurarue%2Fsubpath-serve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurarue%2Fsubpath-serve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurarue%2Fsubpath-serve/lists"}