Express server running on Cloud Functions for Firebase
This example has been merged into my blog-examples repo. This repo will no longer be updated.
Host an Express Server in Cloud Functions for Firebase.
Here is the accompanying Medium Post.
Host your Express Server on Cloud Functions enabling a low-cost, auto-scaling web server leveraging Firebase's sweet developer experience.
Cloud Functions uses Express request and response objects allowing us to pass an Express app directly into the function.
File of interest:
git clone https://github.com/jthegedus/firebase-functions-express-example
cd firebase-functions-express-example
yarn install
yarn serve
This will serve the Cloud Functions locally using the Firebase emulator. Interestingly, the trailing /
is not an issue when hosted locally.
yarn deploy
N.B.: Replace <project-name>
in the .firebaserc
to connect the project to your Firebase project.
Everything was tested on Ubuntu 16.04 & Windows 10 with Bash on Ubuntu on Windows. If you wish for Windows native support please submit an issue so we can work on a Windows branch. Please report any macOS errors as I do not have access to a device to test. My development environment can be found here.