Putting a Simple Website Online with Firebase Hosting
I needed a very small public website for an app: some legal pages, a basic landing page and an app-ads.txt file at the root of the domain.
This is exactly the kind of task where setting up a traditional server feels ridiculous.
I was already using Firebase, so Firebase Hosting turned out to be a very simple solution.
The basic structure was almost boring:
public/
index.html
disclaimer.html
app-ads.txt
firebase.json
.firebaserc
After installing the Firebase CLI, the main setup was running:
firebase init hosting
and selecting the public directory as the folder to deploy.
Firebase then creates the hosting configuration, and deployment is simply:
firebase deploy --only hosting
A few seconds later the files are available on a public web.app address. In my case, the default domain was based on the Firebase project ID.
What I liked about this was how little infrastructure there was to think about. I did not need nginx, a VPS, certificates or a deployment pipeline just to serve a handful of static files. HTTPS is handled automatically, and changing the site is basically editing the files and deploying again.
For a more complicated application I would obviously want more structure, but this was a good reminder that deployment does not always need to be a big architectural decision.
Sometimes the requirement is simply: “I have some files on my laptop and they need to exist on the internet.”
For that kind of problem, Firebase Hosting is almost exactly as complicated as it needs to be.
Topics
