{"id":13995403,"url":"https://github.com/arjsin/http_static","last_synced_at":"2025-07-22T21:32:53.998Z","repository":{"id":90131554,"uuid":"161881770","full_name":"arjsin/http_static","owner":"arjsin","description":"File serving using tower web","archived":false,"fork":false,"pushed_at":"2019-02-03T05:37:22.000Z","size":65,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-10T14:19:19.276Z","etag":null,"topics":["async","http-server","rust","static-server"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arjsin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-15T07:37:36.000Z","updated_at":"2023-02-05T03:44:12.000Z","dependencies_parsed_at":"2024-01-20T18:04:42.483Z","dependency_job_id":"e745f40f-3cb1-4060-a70e-d52eea3c34b7","html_url":"https://github.com/arjsin/http_static","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/arjsin%2Fhttp_static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjsin%2Fhttp_static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjsin%2Fhttp_static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjsin%2Fhttp_static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjsin","download_url":"https://codeload.github.com/arjsin/http_static/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227177953,"owners_count":17743209,"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":["async","http-server","rust","static-server"],"created_at":"2024-08-09T14:03:23.257Z","updated_at":"2024-11-29T17:31:42.641Z","avatar_url":"https://github.com/arjsin.png","language":"Rust","readme":"# http_static\nSimple static file command line HTTP server written in Rust language using tower-web.\nThis supports custom Index file and `404 Not Found` handler both default to `index.html`.\nIt can be useful for serving static websites.\nIt also provides an in memory file serving mode which can be useful when there is only a\nsmall amount data which the server needs to serve. In memory file serving is much faster\nand does not read files once the server is initialized which does all the reading.\nThis mode can be useful for serving web apps.\n\nThe project is work in progress.\n\n## Compile\nThese instructions assume rust and cargo to be installed.\nIf you don't have them, please install using [rustup](https://rustup.rs).\n\n### To getting the repository\n\n```sh\ngit clone https://github.com/arjsin/http_static.git\ncd http_static\n# Future instructions assume this directory\n```\n\n### To build\nRelease build provides good performance while running the program.\n```sh\ncargo build --release\n```\n\n### To run\nRun to listen on default port\n```sh\ncargo run --release\n```\n\nRun to listen on default port with in memory files\n```sh\ncargo run --release -- -m\n```\n\nThe help prints all the possible options\n```sh\ncargo run --release -- -h\n```\n```\nhttp_static\nA lightweight static file server for HTTP\n\nUSAGE:\n    http_static [FLAGS] [OPTIONS]\n\nFLAGS:\n    -h, --help         Prints help information\n    -m, --in_memory    Sets in memory file server\n    -V, --version      Prints version information\n\nOPTIONS:\n    -d, --default \u003cPATH\u003e         Sets path of a file which is served when the file requested in not available, default: index.html\n    -i, --index \u003cFILENAME\u003e       Sets file name inside each directory to be served at path of directory, default: index.html\n    -l, --listen \u003cADDRESS\u003e       Sets the address to listen on, default: [::1]:8080\n    -r, --root \u003cPATH\u003e            Sets path of a directory for serving files, default: .\n        --tls_cert \u003cFILENAME\u003e    Sets file name for TLS certificate, must be present with TLS private key\n        --tls_key \u003cFILENAME\u003e     Sets file name for TLS private key, must be present with TLS certificate\n```\n\n## TODO\n- [x] File serving\n- [x] In memory file serving\n- [ ] Logging\n- [ ] In memory serving, `304 Not Modified` support\n- [ ] In memory serving, file change notification support\n- [x] HTTPS support\n- [ ] Directory listing\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjsin%2Fhttp_static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjsin%2Fhttp_static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjsin%2Fhttp_static/lists"}