Gatsby: [Question] it is posible to run gatsbyJS on firebase cloud functions?

Created on 7 Feb 2018  路  5Comments  路  Source: gatsbyjs/gatsby

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 :)

question or discussion

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.

All 5 comments

@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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andykais picture andykais  路  3Comments

kalinchernev picture kalinchernev  路  3Comments

ferMartz picture ferMartz  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

signalwerk picture signalwerk  路  3Comments