Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.51 KB

File metadata and controls

34 lines (21 loc) · 1.51 KB

Image Maker

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 image/png format.

Setting up the sample

  1. Create a Firebase Project using the Firebase Console.
  2. Clone or download this repo and open the image-maker directory.
  3. You must have the Firebase CLI installed. If you don't have it install it with npm install -g firebase-tools and then configure it with firebase login.
  4. Configure the CLI locally by using firebase use --add and select your project in the list.
  5. 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:

  1. Start serving your project locally using firebase serve --only hosting,functions
  2. Open the app in a browser at https://localhost:5000.

To deploy and test on prod do:

  1. Deploy your project using firebase deploy
  2. Open the app using firebase open hosting:site, this will open a browser.

Contributing

We'd love that you contribute to the project. Before doing so please read our Contributor guide.

License

© Google, 2017. Licensed under an Apache-2 license.