{"id":15903922,"url":"https://github.com/denisdefreyne/adsf","last_synced_at":"2026-01-29T09:17:18.815Z","repository":{"id":10485830,"uuid":"12665391","full_name":"denisdefreyne/adsf","owner":"denisdefreyne","description":"Web server that you can launch instantly in any directory","archived":false,"fork":false,"pushed_at":"2024-09-29T13:35:49.000Z","size":391,"stargazers_count":94,"open_issues_count":3,"forks_count":20,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-20T13:37:08.613Z","etag":null,"topics":["rack","ruby","web-server"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/denisdefreyne.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":"2013-09-07T13:41:10.000Z","updated_at":"2025-07-02T02:12:29.000Z","dependencies_parsed_at":"2024-06-18T17:11:18.268Z","dependency_job_id":null,"html_url":"https://github.com/denisdefreyne/adsf","commit_stats":null,"previous_names":["ddfreyne/adsf"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/denisdefreyne/adsf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisdefreyne%2Fadsf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisdefreyne%2Fadsf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisdefreyne%2Fadsf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisdefreyne%2Fadsf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denisdefreyne","download_url":"https://codeload.github.com/denisdefreyne/adsf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denisdefreyne%2Fadsf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266236669,"owners_count":23897222,"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":["rack","ruby","web-server"],"created_at":"2024-10-06T12:04:48.635Z","updated_at":"2026-01-29T09:17:13.795Z","avatar_url":"https://github.com/denisdefreyne.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem version](https://img.shields.io/gem/v/adsf.svg)](http://rubygems.org/gems/adsf)\n[![Gem downloads](https://img.shields.io/gem/dt/adsf.svg)](http://rubygems.org/gems/adsf)\n[![Build status](https://img.shields.io/travis/ddfreyne/adsf.svg)](https://travis-ci.org/ddfreyne/adsf)\n[![Code Climate](https://img.shields.io/codeclimate/github/ddfreyne/adsf.svg)](https://codeclimate.com/github/ddfreyne/adsf)\n\n# adsf\n\n_adsf_ (**A** **D**ead **S**imple **F**ileserver) is a tiny static web server that you can launch instantly in any directory, like this:\n\n```\n▸ ls -l\ntotal 0\ndrwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 about\ndrwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 contact\n-rw-r--r--  1 ddfreyne  staff   0 May 29 10:04 index.html\ndrwxr-xr-x  2 ddfreyne  staff  68 May 29 10:04 projects\n\n▸ adsf\n[2017-11-19 11:49:20] INFO  WEBrick 1.3.1\n[2017-11-19 11:49:20] INFO  ruby 2.4.2 (2017-09-14) [x86_64-darwin17]\n[2017-11-19 11:49:20] INFO  WEBrick::HTTPServer#start: pid=95218 port=3000\n```\n\n… and now you can go to http://localhost:3000/ and start browsing.\n\nSee `adsf --help` for details.\n\nTo use `adsf --live-reload`, please install the separate `adsf-live` gem. (The live-reload support is not part of adsf itself, because the dependencies of `adsf-live` make it difficult to install under some circumstances.)\n\n## Using adsf programmatically\n\n### Server\n\n`Adsf::Server` runs a web server programmatically. For example:\n\n```ruby\nserver = Adsf::Server.new(root: 'public')\n\n%w[INT TERM].each do |s|\n  Signal.trap(s) { server.stop }\nend\n\nserver.run\n```\n\nIt takes the following options:\n\n- `root` (required): the path to the web root\n- `index_filenames` (optional; defaults to `['index.html']`): (see below)\n- `auto_extensions` (optional; defaults to `[]`; can be a string or an array of strings): If present, the server will automatically append the given extensions when searching for files. For example, `auto_extensions: \".html\"` would cause a request for `/foo` to serve `/foo.html` if there is no file or directory named `/foo`.\n- `host` (optional; defaults to `'127.0.0.1'`): the address of the network interface to listen on\n- `port` (optional; defaults to `3000`): the port to listen on\n- `handler` (optional): the Rack handler to use\n\n### IndexFileFinder\n\nIf you are assembling your own Rack configuration, you can use adsf’s `Adsf::Rack::IndexFileFinder` middleware to make Rack load an index file (e.g. `index.html`) when requesting a directory. For example, the following runs a web server with the 'public' directory as its web root:\n\n```ruby\nuse Adsf::Rack::IndexFileFinder, root: 'public'\nrun Rack::Files.new('public')\n```\n\nIt takes the following options:\n\n- `root` (required): the path to the web root\n\n- `index_filenames` (optional; defaults to `['index.html']`): contains the names of the index filenames that will be served when a directory containing an index file is requested. Usually, this will simply be `['index.html']`, but under different circumstances (when using IIS, for example), the array may have to be modified to include index filenames such as `default.html` or `index.xml`. Here’s an example middleware/application stack that uses custom index filenames:\n\n  ```ruby\n  use Adsf::Rack::IndexFileFinder,\n  \troot: 'public',\n  \tindex_filenames: %w[index.html index.xhtml]\n  run Rack::Files.new('public')\n  ```\n\n**Why not use `Rack::Static`?** Rack comes with `Rack::Static`, whose purpose is similar to, but not the same as, `Adsf::Rack::IndexFileFinder`. In particular:\n\n- `Adsf::Rack::IndexFileFinder` does not serve files, unlike `Rack::Static`. `IndexFileFinder` only rewrites the incoming request and passes it on (usually to `Rack::Files`).\n\n- `Adsf::Rack::IndexFileFinder` supports multiple index files, while `Rack::Static` only supports one (you could have multiple `Rack::Static` middlewares, one for each index filenames, though).\n\n- `Rack::Static` will report the wrong filename on 404 pages: when requesting a directory without an index file, it will e.g. report “File not found: /index.html” rather than “File not found: /”.\n\n- When requesting a directory without specifying the trailing slash, `Adsf::Rack::IndexFileFinder` will redirect to the URL with a trailing slash, unlike `Rack::Static`. This mimics the behavior of typical HTTP servers. For example, when requesting `/foo`, when a `foo` directory exists and it contains `index.html`, `IndexFileFinder` will redirect to `/foo/`.\n\n## Contributors\n\n- Daniel Aleksandersen\n- Ed Brannin\n- Chris Chapman\n- Jan M. Faber\n- Larissa Reis\n- Mark Meves\n- Vipul Amler\n- Paul Cantrell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisdefreyne%2Fadsf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenisdefreyne%2Fadsf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenisdefreyne%2Fadsf/lists"}