{"id":13817514,"url":"https://github.com/elazarl/go-bindata-assetfs","last_synced_at":"2025-05-13T00:10:41.245Z","repository":{"id":565304,"uuid":"21793654","full_name":"elazarl/go-bindata-assetfs","owner":"elazarl","description":"Serves embedded files from `jteeuwen/go-bindata` with `net/http`","archived":false,"fork":false,"pushed_at":"2025-02-01T16:21:08.000Z","size":42,"stargazers_count":867,"open_issues_count":16,"forks_count":117,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-23T18:46:13.003Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elazarl.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":"2014-07-13T15:36:33.000Z","updated_at":"2025-04-16T21:35:42.000Z","dependencies_parsed_at":"2025-02-07T05:00:41.378Z","dependency_job_id":"fe5fe005-cc83-4486-9bd8-88d006f2263a","html_url":"https://github.com/elazarl/go-bindata-assetfs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elazarl%2Fgo-bindata-assetfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elazarl%2Fgo-bindata-assetfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elazarl%2Fgo-bindata-assetfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elazarl%2Fgo-bindata-assetfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elazarl","download_url":"https://codeload.github.com/elazarl/go-bindata-assetfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843215,"owners_count":21972873,"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":"2024-08-04T06:00:47.659Z","updated_at":"2025-05-13T00:10:41.218Z","avatar_url":"https://github.com/elazarl.png","language":"Go","funding_links":[],"categories":["Misc","Go"],"sub_categories":[],"readme":"# go-bindata-assetfs\n\nServe embedded files from [go-bindata](https://github.com/go-bindata/go-bindata) with `net/http`.\n\n[GoDoc](http://godoc.org/github.com/elazarl/go-bindata-assetfs)\n\n### Installation\n\nInstall with\n\n    $ go get github.com/go-bindata/go-bindata/...\n    $ go get github.com/elazarl/go-bindata-assetfs/...\n\n### Creating embedded data\n\nUsage is identical to [go-bindata](https://github.com/go-bindata/go-bindata) usage,\ninstead of running `go-bindata` run `go-bindata-assetfs`.\n\nThe tool will create a `bindata_assetfs.go` file, which contains the embedded data.\n\nA typical use case is\n\n    $ go-bindata-assetfs data/...\n\n### Using assetFS in your code\n\nThe generated file provides an `assetFS()` function that returns a `http.Filesystem`\nwrapping the embedded files. What you usually want to do is:\n\n    http.Handle(\"/\", http.FileServer(assetFS()))\n\nThis would run an HTTP server serving the embedded files.\n\n## Without running binary tool\n\nYou can always just run the `go-bindata` tool, and then\n\nuse\n\n```go\nimport \"github.com/elazarl/go-bindata-assetfs\"\n...\nhttp.Handle(\"/\",\nhttp.FileServer(\n\u0026assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: \"data\"}))\n```\n\nto serve files embedded from the `data` directory.\n\n## SPA applications\n\nFor single page applications you can use `Fallback: \"index.html\"` in AssetFS context, so if route doesn't match the pattern it will fallback to file specified.\n\nexample\n\n```go\nimport \"github.com/elazarl/go-bindata-assetfs\"\n...\nhttp.Handle(\"/\",\nhttp.FileServer(\n\u0026assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: \"data\", Fallback: \"index.html\"}))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felazarl%2Fgo-bindata-assetfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felazarl%2Fgo-bindata-assetfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felazarl%2Fgo-bindata-assetfs/lists"}