Customizing the Firebase hosting environment
Now, since we've successfully deployed our Firebase application, it's normal to change some default values and add another value in order to get the best experience out of it. Firebase offers just that in order to have the best experience while developing and deploying your application.
How to do it...
Let us now learn how to customize Firebase using URL redirect.
Sometimes, we just want to change some URLs for some reasons, and typically sometimes we want to perform URL redirecting in order to maximise our user experience and prevent broken routes. So let's see how we can achieve that:
- Head to your
firebase.json
file and introduce a new section within it calledredirects
. Within the hosting configuration, add the following code lines to your project:
"hosting":{ //[*] Adding the redirect section "redirects":[{ "source":"/books/firebasecookbook", "destination":"/awesomebook", "type":301 }] }
Inside the redirects
array, we're introducing...