{"id":24083274,"url":"https://github.com/mitranim/srv","last_synced_at":"2026-05-15T02:49:25.950Z","repository":{"id":57565027,"uuid":"336762476","full_name":"mitranim/srv","owner":"mitranim","description":"Extremely simple Go tool that serves files out of a given folder, using a file resolution algorithm similar to GitHub Pages, Netlify, or the default Nginx config.","archived":false,"fork":false,"pushed_at":"2024-03-21T13:37:02.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T06:44:39.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitranim.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-07T10:48:35.000Z","updated_at":"2023-01-09T18:27:28.000Z","dependencies_parsed_at":"2023-01-23T17:35:11.807Z","dependency_job_id":null,"html_url":"https://github.com/mitranim/srv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fsrv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fsrv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fsrv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fsrv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitranim","download_url":"https://codeload.github.com/mitranim/srv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240959115,"owners_count":19884911,"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":[],"created_at":"2025-01-09T23:56:15.533Z","updated_at":"2026-05-15T02:49:25.906Z","avatar_url":"https://github.com/mitranim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\n\nExtremely simple Go tool that serves files out of a given folder, using a file resolution algorithm similar to GitHub Pages, Netlify, or the default Nginx config. Provides a Go \"library\" (less than 100 LoC) and an optional CLI tool.\n\n## Why\n\nUseful when making a site that will be served by GitHub Pages or similar. Usable from Go code. Usable from a shell. Not overweight.\n\n## Usage\n\nAn almost drop-in replacement for `http.FileServer`:\n\n```go\nimport \"github.com/mitranim/srv\"\n\nhttp.ListenAndServe(\":\u003csome-port\u003e\", srv.FileServer(\".\"))\n```\n\nFor CLI usage, first install Go: https://golang.org. Then run this:\n\n```sh\ngo install github.com/mitranim/srv/srv@latest\n\n# Get help\nsrv -h\n\n# Actually run\nsrv\n```\n\nThis will compile the executable into `$GOPATH/bin/srv`. Make sure `$GOPATH/bin` is in your `$PATH` so the shell can discover the `srv` command. For example, my `~/.profile` contains this:\n\n```sh\nexport GOPATH=~/go\nexport PATH=$PATH:$GOPATH/bin\n```\n\nAlternatively, you can run the executable using the full path. At the time of writing, `~/go` is the default `$GOPATH` for Go installations. Some systems may have a different one.\n\n```sh\n~/go/bin/srv\n```\n\n## File Resolution\n\n* For directories including `/`, use `index.html` when available.\n* For \"clean\" links without an extension, try appending `.html`.\n* For \"not found\", try using `404.html` if one exists, falling back on a simple hardcoded message.\n\n## License\n\nhttps://unlicense.org\n\n## Misc\n\nI'm receptive to suggestions. If this library _almost_ satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Fsrv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitranim%2Fsrv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Fsrv/lists"}