diff --git a/README.md b/README.md index e5bc7ec..dc3446a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # example-server +一个简单的web 服务器例子项目 + +## 依赖 +* [bricks](https://git.opencomputing.cn/yumoqing/bricks.git)前端界面包 +* [apppublic](https://git.opencomputing.cn/yumoqing/apppublic.git)python的基础工具包 +* [sqlor](https://git.opencomputing.cn/yumoqing/sqlor.git) +* [ahserver](https://git.opencomputing.cn/yumoqing/ahserver.git) +* [bricks-for-python](https://git.opencomputing.cn/yumoqing/bricks-for-python.git) + +## 安装 +``` +git clone https://git.opencomputing.cn/yumoqing/example-server.git +pip install apppublic sqlor ahserver bricks-for-python +``` + +## 启动服务 +``` +cd example-server +python app/example.py +``` diff --git a/app/example.py b/app/example.py index db76f3c..c68b7d3 100644 --- a/app/example.py +++ b/app/example.py @@ -1,5 +1,6 @@ from ahserver.serverenv import ServerEnv from ahserver.webapp import webapp +from bricks_for_python.init import load_pybricks def get_module_dbname(module_name): return 'test' @@ -7,6 +8,7 @@ def get_module_dbname(module_name): def init(): env = ServerEnv() env.get_module_dbname = get_module_dbname + load_pybricks() if __name__ == '__main__': webapp(init)