mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* Updating Python hot HTTP sample - using latest hotfn 0.0.5 release (made life lot easier) * Updating to latest 0.0.6 release What's new? - new request data signature: context, data, loop - supports event loop (very useful for request body handeler of coroutine type) * Updating example with respect to recent fdk-python release * Addressing review comments
21 lines
449 B
Python
21 lines
449 B
Python
import fdk
|
|
|
|
|
|
def handler(context, data=None, loop=None):
|
|
"""
|
|
This is just an echo function
|
|
:param context: request context
|
|
:type context: hotfn.http.request.RequestContext
|
|
:param data: request body
|
|
:type data: object
|
|
:param loop: asyncio event loop
|
|
:type loop: asyncio.AbstractEventLoop
|
|
:return: echo of request body
|
|
:rtype: object
|
|
"""
|
|
return data
|
|
|
|
|
|
if __name__ == "__main__":
|
|
fdk.handle(handler)
|