12 lines
335 B
Python
12 lines
335 B
Python
config = {
|
|
"name": "HelloWorld",
|
|
"type": "api",
|
|
"path": "/hello",
|
|
"method": "GET",
|
|
"emits": ["hello.triggered"]
|
|
}
|
|
|
|
async def handler(req, context):
|
|
await context.emit({"topic": "hello.triggered", "data": {"message": "Event from API"}})
|
|
return {"status": 200, "body": {"message": "Hello World from Motia!"}}
|