const functions = require('firebase-functions');
exports.app = functions.https.onRequest(gatsbyMiddleware);
Im trying to deploy a gatsby site using firebase functions. But I need to provide a middleware, or. Deploy gatsby somehow and fallback any request to gatsby instance.. any one has an idea about? Thanks :)
@k1r0s What are you trying to achieve? Gatsby generates HTML files, so once you somehow build your project, you can host it using e.g. https://firebase.google.com/docs/hosting. Or use e.g. https://www.netlify.com to build, deploy and host it for you.
Im trying to read the docs before asking anything
@k1r0s did you figure this out? My idea is to use a cloud function to build and deploy my gatsby site whenever an authorized user adds new content.
I guess you can use could function as a proxy, and dispatch user request to another server which is effectively serving static assets
I've written a step by step guide on how to host a Gatsby site on Firebase, as well as deploying it automatically using Google Cloud Build.
Automatically Deploying a Gatsby Site to Firebase with Google Cloud Build (CI/CD)
Most helpful comment
@k1r0s did you figure this out? My idea is to use a cloud function to build and deploy my gatsby site whenever an authorized user adds new content.