Skip to content

Instantly share code, notes, and snippets.

@Terkea
Last active September 26, 2020 16:58
Show Gist options
  • Save Terkea/19c5a2a26edc60ca4b34f6059721032e to your computer and use it in GitHub Desktop.
Save Terkea/19c5a2a26edc60ca4b34f6059721032e to your computer and use it in GitHub Desktop.
firebase router
You need to make sure the rewrites are enabled in your Firebase hosting configuration to redirect all requests to your index.html file. This assumes you are using create-react-app:
```
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]}
]
}
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment