{"id":21432105,"url":"https://github.com/lookfirst/history-api-fallback","last_synced_at":"2025-07-14T12:32:46.979Z","repository":{"id":31571349,"uuid":"35136103","full_name":"lookfirst/history-api-fallback","owner":"lookfirst","description":"Fallback to index.html for applications that are using the HTML 5 history API","archived":false,"fork":false,"pushed_at":"2017-11-13T03:00:15.000Z","size":8,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-11T12:55:05.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/lookfirst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-06T02:55:12.000Z","updated_at":"2024-04-11T12:55:05.009Z","dependencies_parsed_at":"2022-08-24T00:31:07.112Z","dependency_job_id":null,"html_url":"https://github.com/lookfirst/history-api-fallback","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/lookfirst%2Fhistory-api-fallback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Fhistory-api-fallback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Fhistory-api-fallback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lookfirst%2Fhistory-api-fallback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lookfirst","download_url":"https://codeload.github.com/lookfirst/history-api-fallback/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225976193,"owners_count":17554197,"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-11-22T23:16:28.615Z","updated_at":"2024-11-22T23:16:29.157Z","avatar_url":"https://github.com/lookfirst.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# history-api-fallback\n\n## Introduction\n\nSingle Page Applications (SPA) typically only utilise one index file that is\naccessible by web browsers: usually `index.html`. Navigation in the application\nis then commonly handled using JavaScript with the help of the\n[HTML5 History API](http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-history-interface).\nThis results in issues when the user hits the refresh button or is directly\naccessing a page other than the landing page, e.g. `/help` or `/help/online`\nas the web server bypasses the index file to locate the file at this location.\nAs your application is a SPA, the web server will fail trying to retrieve the file and return a *404 - Not Found*\nmessage to the user.\n\nThis tiny servlet filter addresses some of the issues. Specifically, it will change\nthe requested location to the index you specify (default being `index.html`)\nwhenever there is a request which fulfils the following criteria:\n\n 1. The request is a GET request\n 2. which accepts `text/html` and is not `application/json`\n 3. is not a direct file request, i.e. the requested path does not contain a `.` (DOT) character\n \nThis project borrows heavily from the \n[connect-history-api-fallback](https://github.com/bripkens/connect-history-api-fallback) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flookfirst%2Fhistory-api-fallback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flookfirst%2Fhistory-api-fallback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flookfirst%2Fhistory-api-fallback/lists"}