This demo run an Next.js SSR application using Firebase Functions and Firebase Hosting.
Set up firebase:
- create a project through the firebase web console
- grab the projects ID from the web consoles URL: https://console.firebase.google.com/project/
- rename
.firebaserc.sample
in.firebaserc
and fill %YOUR_FIREBASE_PROJECT_ID%
Set up next.js:
- rename
next.config.js.sample
innext.config.js
and fill %YOUR_FIREBASE_PROJECT_ID%
Run:
- npm install
- npm run dev (to test locally)
- npm run firebase:deploy (to build and deploy to firebase)
- Currently two firebase functions are used, one to handle next API Routes requests and another for SSR / static assets.
firebase serve
is not working, need to figure out why.