This sample shows how to create various images through Functions and serve it to the client
It uses node-canvas to create a canvas environment on Node. That canvas is then used to create either a clock, sparkline chart, or sphere(s) in png format. The images are then cached on the server and sent to the client in
Setting up the sample
- Create a Firebase Project using the Firebase Console.
- Clone or download this repo and open the
- You must have the Firebase CLI installed. If you don't have it install it with
npm install -g firebase-toolsand then configure it with
- Configure the CLI locally by using
firebase use --addand select your project in the list.
- Install dependencies locally by running:
cd functions; npm install;
Deploy and test
This sample comes with a web-based UI for testing the function. To test locally do:
- Start serving your project locally using
firebase serve --only hosting,functions
- Open the app in a browser at
To deploy and test on prod do:
- Deploy your project using
- Open the app using
firebase open hosting:site, this will open a browser.
We'd love that you contribute to the project. Before doing so please read our Contributor guide.
© Google, 2017. Licensed under an Apache-2 license.