Files
fx-serverless/examples/functions/Python/README.md
2020-12-11 19:55:31 +08:00

582 B
Vendored

Make a Python function a service with fx

Write a function like,

def fx(request):
    return "hello world"

then deploy it with fx up command,

$ fx up -p 8080:3000 func.py

test it using curl

$ curl 127.0.0.1:8080

HTTP/1.0 200 OK
Content-Length: 11
Content-Type: text/html; charset=utf-8
Date: Thu, 08 Aug 2019 05:33:32 GMT
Server: Werkzeug/0.12.2 Python/3.6.3

hello world

request

The request object is a request of flask