Files
fx-serverless/examples/functions/Python
2019-08-09 09:10:49 +08:00
..
2019-08-09 09:10:49 +08:00
2019-08-09 09:10:49 +08:00

Make a Python function a service with fx

Write a function like,

def fx(requenst):
    return "hello world"

then deploy it with fx up command,

$ fx up -p 8080:3000 func.go

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