轻松部署功能
firefly-python的Python项目详细描述
fireffly
>fireffly是一个将python函数公开为restfulapi的工具。
install
~~~~~
平方比
定义Square(n):
返回n*n
并与firefly一起运行:
…代码::bash
$firefly sq.sq.square
[2017-06-08 12:45:11+0530][20237][info]启动gunicorn 19.7.1
[2017-06-08 12:45:11+0530][20237][info]收听:http://127.0.0.1:8000(20237)
…
与服务器交互的接口。
代码::python
>;>;来自firefly.client import client
>;>;client=client(“http://127.0.0.1:8000”)
>;>;client.square(n=4)
16
你可以直接使用这个api:
代码::bash
$curl-d'{“n”:4}http://127.0.0.1:8000/平方
16