Search code examples
firebasefirebase-hosting

Mimicking firebase.json settings for local development


I just started messing around with the Firebase hosting features, which is great - my question comes to the rewrites you can specify in the firebase.json file.

 "rewrites": [ {
    "source": "**",
    "destination": "/index.html"
  } ],

Is it possible to utilize these settings somehow when coding locally? I use Gulp and Browser-sync which starts up a simple web server, which would do the job fine but then to accommodate these rewrites I end up having to create a node server with its own matching route patterns. I feel like I'm missing something.


Solution

  • Released in firebase-cli 2.0 you can now run

    firebase serve
    

    Which will statically serve your files the same way as remote hosting.

    https://www.firebase.com/blog/2015-10-13-google-login-and-firebase-cli-2.html