GoogleCloudPlatform/cloud-functions-emulator

Name: cloud-functions-emulator

Owner: Google Cloud Platform

Description: A local emulator for Google Cloud Functions that allows you to deploy, run, and debug your Cloud Functions on your local machine before deploying them to the production Google Cloud Functions service.

Created: 2016-10-24 16:42:35.0

Updated: 2018-01-18 05:53:44.0

Pushed: 2018-01-16 01:36:33.0

Homepage: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/wiki

Size: 2653

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Google Inc. logo

Google Cloud Functions Emulator

NPM Tests Coverage

Disclaimer: This is not an official Google product.

Table of Contents

What is the Google Cloud Functions Emulator?

The Google Cloud Functions Emulator is a Node.js application that implements the Google Cloud Functions API, and includes a CLI with which you can manage the application.

The Emulator allows you to deploy, run, and debug your Cloud Functions on your local machine before deploying them to the production Google Cloud Functions service.

How do I get started?
  1. Write a function:

    mkdir helloWorld
    cd helloWorld
    touch index.js
    echo 'exports.helloWorld = (req, res) => res.send("Hello, World!");' > index.js
    
  2. Install the Emulator:

    NPM:

    npm install -g @google-cloud/functions-emulator
    

    Yarn:

    yarn global add @google-cloud/functions-emulator
    

    Or read more in the detailed installation instructions.

  3. Start the Emulator:

    functions start
    
  4. Deploy your function:

    functions deploy helloWorld --trigger-http
    

    Get help deploying a function with functions deploy --help.

  5. Call your function:

    functions call helloWorld
    
  6. View the logs:

    functions logs read
    
Where is the documentation?

For a quick reference, the Emulator CLI is self-documenting. Run the following to get help with the CLI:

functions --help

For everything else see the How-To Guides.

Contributing

To give feedback, report a bug, or request a feature, please open an issue.

To contribute a change, check out the contributing guide.

License

Copyright 2017, Google, Inc.

Licensed under the Apache License, Version 2.0

See the full license.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.