Python

Supports: python3.7

Function declaration

hello.py
def endpoint(req):
    return "Hello World"

Public function should be named as endpoint within a module.

Argument req is a map, and has following properties:

{  
    "method": "",  
    "path": "",  
    "body": {},  
    "headers": {},
    "query": {} 
}

NOTE: Always return string. For RUNTIME ERRORS check dashboard.

Restrictions

  • Module name cannot be func.py.

Example

This is an example for couting no of times API has been accessed. For utils.py, see API Reference of python.

Last updated