Updated on 2023-11-22 GMT+08:00

APIG Events

FunctionGraph can create function-based API endpoints through APIG.

To create HTTP endpoints as event sources for FunctionGraph, use the HTTP event syntax.

HTTP Endpoint

In this setting, the first function should be run when someone accesses the 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 is an example:
# serverless.yml

functions:
  hello:
    handler: index.hello
    events:
      - apigw:
          env_id: DEFAULT_ENVIRONMENT_RELEASE_ID
          env_name: RELEASE
          req_method: GET
          path: /test
          name: API_test

For details about the handler signature used for such events, see the Handler.