Last active
September 26, 2020 16:58
-
-
Save Terkea/19c5a2a26edc60ca4b34f6059721032e to your computer and use it in GitHub Desktop.
firebase router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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