Edit on github

#HTTP

Google Cloud Functions can create function based API endpoints.

To create HTTP endpoints as event sources for your Google Cloud Functions, use the http event syntax.

It might be helpful to read the Google Cloud Functions HTTP docs to learn the full functionality.

#HTTP events

#HTTP endpoint

This setup specifies that the first function should be run when someone accesses the Functions API endpoint via a GET request. You can get the URL for the endpoint by running the serverless info command after deploying your service.

Here's an example:

# serverless.yml

functions:
  first:
    handler: http
    events:
      - http: path
// index.js

exports.first = (request, response) => {
  response.status(200).send('Hello World!');
};

Note: See the documentation about the function handlers to learn how your handler signature should look like to work with this type of event.

Made with love in San Francisco + Atlanta, Austria, Germany, Pakistan, Poland, Nebraska & Thailand

Serverless, Inc. © 2018

Join our newsletter and get the latest news about Serverless products and happenings. #noSpamWePromise