{"id":20864869,"url":"https://github.com/lezgomatt/stiff","last_synced_at":"2025-10-16T19:13:47.208Z","repository":{"id":57546313,"uuid":"253264370","full_name":"lezgomatt/stiff","owner":"lezgomatt","description":"An opinionated static file web server","archived":false,"fork":false,"pushed_at":"2024-05-02T06:42:07.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T08:19:33.406Z","etag":null,"topics":["go","static-site","web-server"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lezgomatt.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-04-05T15:15:10.000Z","updated_at":"2024-05-02T06:42:11.000Z","dependencies_parsed_at":"2024-06-21T11:55:48.471Z","dependency_job_id":null,"html_url":"https://github.com/lezgomatt/stiff","commit_stats":null,"previous_names":["undecidabot/stiff"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lezgomatt%2Fstiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lezgomatt%2Fstiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lezgomatt%2Fstiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lezgomatt%2Fstiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lezgomatt","download_url":"https://codeload.github.com/lezgomatt/stiff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243238970,"owners_count":20259126,"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":["go","static-site","web-server"],"created_at":"2024-11-18T05:44:47.663Z","updated_at":"2025-10-16T19:13:47.119Z","avatar_url":"https://github.com/lezgomatt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stiff\n\nAn opinionated static file web server.\nBuilt to make serving static websites fast and easy.\n\n\n## Features\n\n- Clean URLs - no trailing slashes or `.html` extensions\n- Serve precompressed files (brotli and gzip) for faster downloads\n- Easy resource caching via `ETag` and `Last-Modified` headers\n- Set your own headers for even better caching and security\n\n**NOTE:**\nstiff is meant to be used behind a reverse proxy, features like HTTPS, access logs, etc. are not provided.\n\n\n## Usage\n\n- Place the files to be served in a directory named `public`\n- While the server is running, these files must *not* be modified (including additions)\n- For precompressed files, the filename must match the original with a `.gz` and `.br` extension\n- To generate the precompressed files, you will have to use a separate tool like [prepa](https://github.com/lezgomatt/prepa)\n\n\n## Configuration\n\nBy default, the server will listen on port 1717, but it can be set via the `PORT` environment variable.\n\nYou can configure stiff with a JSON file called `stiff.json` (at the root, *not* inside the `public` directory).\n\nError pages can be customized by providing `404.html` and `500.html` in the `public` directory.\n\n### Example `stiff.json`\n\n```json\n{\n    \"headers\": {\n        \"X-Content-Type-Options\": \"nosniff\",\n        \"Cache-Control\": \"public, no-cache\"\n    },\n    \"lastmod\": true,\n    \"routes\": {\n        \"/\": { \"lastmod\": false },\n        \"/app\": { \"serve\": \"webapp.html\" },\n        \"/app/\": { \"serve\": \"webapp.html\" },\n        \"/assets/\": {\n            \"headers\": { \"Cache-Control\": \"public, max-age=300\" }\n        },\n        \"/assets/videos/\": {\n            \"headers\": { \"Cache-Control\": \"public, max-age=300\" },\n            \"etag\": false\n        }\n    },\n    \"mimetypes\": {\n        \".atom\":  \"application/atom+xml\"\n    }\n}\n```\n\n### Top-Level Options\n\n| Key | Description |\n| - | - |\n| `headers` | Set additional headers |\n| `etag` | Set the `ETag` header (default: `true`) |\n| `lastmod` | Set the `Last-Modified` header (default: `false`) |\n| `mimetypes` | Set custom MIME types; extensions must begin with a dot (`.`) |\n\n### Route-Level Options\n\n- Route-level options are placed under the `routes` key\n- Routes must begin with a slash (`/`)\n- Routes must end with a slash (`/`) for directories, i.e. `/assets` is separate from `/assets/`\n- Only the most specific route match is applied (they don't cascade)\n\n| Key | Description |\n| - | - |\n| `headers` | Same as the top-level; headers will merge with the ones specified at the top-level |\n| `etag` | Same as the top-level; if not specified, the top-level value will be used |\n| `lastmod` | Same as the top-level; if not specified, the top-level value will be used |\n| `serve` | Always serve the specified file for all subpaths (for SPAs) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flezgomatt%2Fstiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flezgomatt%2Fstiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flezgomatt%2Fstiff/lists"}