This commit is contained in:
yumoqing 2025-10-22 14:25:03 +08:00
parent d1d74f55d0
commit 5dda416a73
2 changed files with 22 additions and 0 deletions

View File

@ -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
```

View File

@ -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)