@wneng/create-keel 0.3.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +206 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/templates/ci-gitee/files/pipeline.yml +62 -0
- package/src/templates/ci-github/files/ci.yml +160 -0
- package/src/templates/db-go-elasticsearch/files/Makefile +18 -0
- package/src/templates/db-go-elasticsearch/files/apply_templates.go +80 -0
- package/src/templates/db-go-elasticsearch/files/db-README.md +57 -0
- package/src/templates/db-go-elasticsearch/files/go.mod +7 -0
- package/src/templates/db-go-elasticsearch/files/index-template-init.json +25 -0
- package/src/templates/db-go-elasticsearch/fragment.yaml +22 -0
- package/src/templates/db-go-migrate-mysql/files/000001_init.down.sql +3 -0
- package/src/templates/db-go-migrate-mysql/files/000001_init.up.sql +35 -0
- package/src/templates/db-go-migrate-mysql/files/Makefile +33 -0
- package/src/templates/db-go-migrate-mysql/files/db-README.md +77 -0
- package/src/templates/db-go-migrate-mysql/files/go.mod +8 -0
- package/src/templates/db-go-migrate-mysql/fragment.yaml +22 -0
- package/src/templates/db-go-migrate-postgres/files/000001_init.down.sql +3 -0
- package/src/templates/db-go-migrate-postgres/files/000001_init.up.sql +32 -0
- package/src/templates/db-go-migrate-postgres/files/Makefile +31 -0
- package/src/templates/db-go-migrate-postgres/files/db-README.md +71 -0
- package/src/templates/db-go-migrate-postgres/files/go.mod +8 -0
- package/src/templates/db-go-migrate-postgres/fragment.yaml +22 -0
- package/src/templates/db-java-elasticsearch/files/EsTemplateApplier.java +86 -0
- package/src/templates/db-java-elasticsearch/files/db-README.md +63 -0
- package/src/templates/db-java-elasticsearch/files/index-template-init.json +25 -0
- package/src/templates/db-java-elasticsearch/files/pom.xml +134 -0
- package/src/templates/db-java-elasticsearch/fragment.yaml +19 -0
- package/src/templates/db-java-flyway-mysql/files/V1__init.sql +44 -0
- package/src/templates/db-java-flyway-mysql/files/application.yaml +39 -0
- package/src/templates/db-java-flyway-mysql/files/db-README.md +102 -0
- package/src/templates/db-java-flyway-mysql/files/pom.xml +172 -0
- package/src/templates/db-java-flyway-mysql/fragment.yaml +19 -0
- package/src/templates/db-java-flyway-postgres/files/V1__init.sql +40 -0
- package/src/templates/db-java-flyway-postgres/files/application.yaml +37 -0
- package/src/templates/db-java-flyway-postgres/files/db-README.md +75 -0
- package/src/templates/db-java-flyway-postgres/files/pom.xml +166 -0
- package/src/templates/db-java-flyway-postgres/fragment.yaml +19 -0
- package/src/templates/db-node-elasticsearch/files/apply-templates.cjs +60 -0
- package/src/templates/db-node-elasticsearch/files/db-README.md +76 -0
- package/src/templates/db-node-elasticsearch/files/index-template-init.json +26 -0
- package/src/templates/db-node-elasticsearch/files/package.json +26 -0
- package/src/templates/db-node-elasticsearch/fragment.yaml +19 -0
- package/src/templates/db-node-knex-mysql/files/db-README.md +90 -0
- package/src/templates/db-node-knex-mysql/files/knexfile.cjs +72 -0
- package/src/templates/db-node-knex-mysql/files/migrations-init.cjs +42 -0
- package/src/templates/db-node-knex-mysql/files/package.json +31 -0
- package/src/templates/db-node-knex-mysql/files/seeds-dev-fixtures.cjs +38 -0
- package/src/templates/db-node-knex-mysql/files/seeds-prod-dictionaries.cjs +25 -0
- package/src/templates/db-node-knex-mysql/fragment.yaml +25 -0
- package/src/templates/db-node-knex-postgres/files/db-README.md +81 -0
- package/src/templates/db-node-knex-postgres/files/knexfile.cjs +67 -0
- package/src/templates/db-node-knex-postgres/files/migrations-init.cjs +42 -0
- package/src/templates/db-node-knex-postgres/files/package.json +31 -0
- package/src/templates/db-node-knex-postgres/files/seeds-dev-fixtures.cjs +36 -0
- package/src/templates/db-node-knex-postgres/files/seeds-prod-dictionaries.cjs +26 -0
- package/src/templates/db-node-knex-postgres/fragment.yaml +25 -0
- package/src/templates/db-python-alembic-mysql/files/0001_init.py +70 -0
- package/src/templates/db-python-alembic-mysql/files/alembic.ini +47 -0
- package/src/templates/db-python-alembic-mysql/files/db-README.md +87 -0
- package/src/templates/db-python-alembic-mysql/files/env.py +71 -0
- package/src/templates/db-python-alembic-mysql/files/pyproject.toml +52 -0
- package/src/templates/db-python-alembic-mysql/files/script.py.mako +26 -0
- package/src/templates/db-python-alembic-mysql/fragment.yaml +25 -0
- package/src/templates/db-python-alembic-postgres/files/0001_init.py +62 -0
- package/src/templates/db-python-alembic-postgres/files/alembic.ini +45 -0
- package/src/templates/db-python-alembic-postgres/files/db-README.md +70 -0
- package/src/templates/db-python-alembic-postgres/files/env.py +62 -0
- package/src/templates/db-python-alembic-postgres/files/pyproject.toml +52 -0
- package/src/templates/db-python-alembic-postgres/files/script.py.mako +25 -0
- package/src/templates/db-python-alembic-postgres/fragment.yaml +25 -0
- package/src/templates/db-python-elasticsearch/files/apply_templates.py +55 -0
- package/src/templates/db-python-elasticsearch/files/db-README.md +57 -0
- package/src/templates/db-python-elasticsearch/files/index-template-init.json +25 -0
- package/src/templates/db-python-elasticsearch/files/pyproject.toml +50 -0
- package/src/templates/db-python-elasticsearch/fragment.yaml +19 -0
- package/src/templates/docs-skeleton/files/governance-database.md +150 -0
- package/src/templates/docs-skeleton/fragment.yaml +3 -0
- package/src/templates/root-files/files/AGENTS.md +6 -2
- package/src/templates/server-python/files/README.md +75 -2
- package/src/templates/server-python/files/app-init.py +11 -1
- package/src/templates/server-python/files/config.py +40 -0
- package/src/templates/server-python/files/main.py +62 -0
- package/src/templates/server-python/files/pyproject.toml +14 -1
- package/src/templates/server-python/files/test_healthz.py +36 -0
- package/src/templates/server-python/fragment.yaml +10 -1
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
| `.claude/` | AI | Claude Code slash-commands |
|
|
46
46
|
<% } %>
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
<% if (it.options.database !== 'none') { %>> **数据库相关产物**(已启用 `database=<%= it.options.database %>`):`server/db/`(迁移、种子<% if (it.options.database === 'elasticsearch') { %>、ES index template<% } %>、运维脚本入口)的归属规则见 [`docs/governance/database.md`](docs/governance/database.md)。<% if (it.options.backend === 'java') { %> Java + <%= it.options.database === 'elasticsearch' ? 'spring-data-elasticsearch' : 'Flyway' %> 因 Spring Boot classpath 约定,<%= it.options.database === 'elasticsearch' ? 'index template' : '迁移' %>文件实际在 `server/src/main/resources/<%= it.options.database === 'elasticsearch' ? 'index-templates/' : 'db/migration/' %>`。<% } %>
|
|
49
|
+
|
|
50
|
+
<% } %>### 1.1 单应用 vs 多应用模式
|
|
49
51
|
|
|
50
52
|
每个执行环境目录(`server/` `web/` `mobile/` `miniapp/` `agent/`)默认处于**单应用模式**。需要容纳第二个应用时切换到**多应用模式**:
|
|
51
53
|
|
|
@@ -176,7 +178,8 @@
|
|
|
176
178
|
| `docs/assets/**` 或根 `.gitattributes` | `docs/governance/assets.md` |
|
|
177
179
|
| `ops/**` 或 `deploy/**` | `docs/governance/deploy-ops.md`、`docs/governance/security.md` |
|
|
178
180
|
| `tools/**` 或 `scripts/**` | `docs/governance/tools-scripts.md` |
|
|
179
|
-
<% if (it.options.
|
|
181
|
+
<% if (it.options.database !== 'none') { %>| `server/db/**`(迁移 / 种子 / ES template / applier) | `docs/governance/database.md`、`contracts/dictionaries/`(如改字典 seed) |
|
|
182
|
+
<% } %><% if (it.options.ci === 'gitee') { %>| `.gitee/**` | `docs/governance/ci.md`、`docs/governance/security.md` |
|
|
180
183
|
<% } else { %>| `.github/**` | `docs/governance/ci.md`、`docs/governance/security.md` |
|
|
181
184
|
<% } %>
|
|
182
185
|
|
|
@@ -205,6 +208,7 @@
|
|
|
205
208
|
| ops / deploy 完整规则 | [`docs/governance/deploy-ops.md`](docs/governance/deploy-ops.md) |
|
|
206
209
|
| tools / scripts 完整规则 | [`docs/governance/tools-scripts.md`](docs/governance/tools-scripts.md) |
|
|
207
210
|
| 变更分级(六档 Tier) | [`docs/governance/change-tiers.md`](docs/governance/change-tiers.md) |
|
|
211
|
+
| 数据库目录 / 迁移工具 / SQL 归属 | [`docs/governance/database.md`](docs/governance/database.md) |
|
|
208
212
|
| 完整 checklist | [`docs/governance/checklists.md`](docs/governance/checklists.md) |
|
|
209
213
|
| 治理细则索引 | [`docs/governance/README.md`](docs/governance/README.md) |
|
|
210
214
|
|
|
@@ -1,4 +1,77 @@
|
|
|
1
1
|
# server/
|
|
2
2
|
|
|
3
|
-
Python backend for **<%= it.options.projectName
|
|
4
|
-
|
|
3
|
+
Python backend for **<%= it.options.projectName %>**, built on **FastAPI**.
|
|
4
|
+
|
|
5
|
+
> Contract First:路由 / 请求体 / 响应体应当与 [`../contracts/openapi/api.yaml`](../contracts/openapi/api.yaml) 对齐。新增端点的工作流见根 `AGENTS.md` §6(变更分级)+ `docs/governance/change-tiers.md`:端点新增 / 字段新增是 Tier 3,必须先冻结 contracts 再写实现。
|
|
6
|
+
|
|
7
|
+
## 目录布局
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
server/
|
|
11
|
+
├── pyproject.toml # 依赖钉版本、ruff / mypy / pytest 配置
|
|
12
|
+
├── app/
|
|
13
|
+
│ ├── __init__.py # re-export `app` 给 `python -m app`
|
|
14
|
+
│ ├── main.py # FastAPI 实例 + /healthz + CORS
|
|
15
|
+
│ └── config.py # pydantic-settings;从环境 / .env 读配置
|
|
16
|
+
└── tests/
|
|
17
|
+
└── test_healthz.py # ASGI smoke test
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 工具与版本
|
|
21
|
+
|
|
22
|
+
| 项 | 值 |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Python | 3.11+ |
|
|
25
|
+
| Framework | FastAPI `0.115.5` |
|
|
26
|
+
| ASGI server | uvicorn `0.32.0` |
|
|
27
|
+
| Validation | pydantic `2.9.2` + pydantic-settings `2.6.1` |
|
|
28
|
+
| Lint / format | ruff `0.6.8+` |
|
|
29
|
+
| Type check | mypy `1.11.0+`(strict-ish) |
|
|
30
|
+
| Test | pytest `8.3.0+` + pytest-asyncio + httpx |
|
|
31
|
+
|
|
32
|
+
版本钉死见 `pyproject.toml`,并镜像到 `docs/03-工程规范与研发基础设施/tech-stack-server.md`。governance-lint 检测两边漂移并阻断 PR。
|
|
33
|
+
|
|
34
|
+
## 常用命令
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 创建虚拟环境 + 装依赖
|
|
38
|
+
python -m venv .venv && source .venv/bin/activate
|
|
39
|
+
pip install -e ".[dev]"
|
|
40
|
+
|
|
41
|
+
# 本地开发(热加载)
|
|
42
|
+
uvicorn app.main:app --reload --port 8000
|
|
43
|
+
# 浏览自动生成的 OpenAPI UI:http://127.0.0.1:8000/docs
|
|
44
|
+
|
|
45
|
+
# 测试 / lint / format / typecheck
|
|
46
|
+
pytest -q
|
|
47
|
+
ruff check .
|
|
48
|
+
ruff format --check .
|
|
49
|
+
mypy .
|
|
50
|
+
|
|
51
|
+
# 安全扫描
|
|
52
|
+
pip-audit
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 配置
|
|
56
|
+
|
|
57
|
+
环境变量优先级:CLI / 容器注入 > `.env` 文件 > `app/config.py` 默认值。
|
|
58
|
+
|
|
59
|
+
| 变量 | 默认 | 说明 |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `APP_NAME` | `<projectName>-server` | 显示在 OpenAPI title |
|
|
62
|
+
| `APP_VERSION` | `0.1.0` | 显示在 OpenAPI version |
|
|
63
|
+
| `CORS_ALLOW_ORIGINS` | `["http://localhost:5173","http://localhost:3000"]` | 逗号分隔;生产环境收紧 |
|
|
64
|
+
|
|
65
|
+
## 部署
|
|
66
|
+
|
|
67
|
+
打包 / 镜像 / 流水线归 `deploy/` 与 `ops/`,详见 [`../docs/governance/deploy-ops.md`](../docs/governance/deploy-ops.md)。最小生产命令示例:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 与契约的同步
|
|
74
|
+
|
|
75
|
+
- API 端点:`contracts/openapi/api.yaml` → `app/main.py` 路由;改契约同 PR 改实现
|
|
76
|
+
- 字典 / 枚举:`contracts/dictionaries/enums.yaml`(如启用)→ Pydantic Enum
|
|
77
|
+
- 错误码:`contracts/errors/error-codes.yaml` → Exception → HTTP status 映射
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""<%= it.options.projectName %>-server.
|
|
2
|
+
|
|
3
|
+
Application package. Entry point: app.main:app
|
|
4
|
+
Run locally: `uvicorn app.main:app --reload`
|
|
5
|
+
|
|
6
|
+
Contract First:路由实现见 contracts/openapi/api.yaml;新端点先改契约再写代码。
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from .main import app
|
|
10
|
+
|
|
11
|
+
__all__ = ["app"]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Application configuration via pydantic-settings.
|
|
2
|
+
|
|
3
|
+
环境变量映射规则:
|
|
4
|
+
- 全部大写、`_` 分隔
|
|
5
|
+
- 嵌套字段用 `__` 分隔(pydantic-settings 默认)
|
|
6
|
+
- 例:APP_NAME / APP_VERSION / CORS_ALLOW_ORIGINS=http://localhost:5173,http://localhost:3000
|
|
7
|
+
|
|
8
|
+
`.env` 文件由 pydantic-settings 自动加载(项目根目录)。
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from pydantic import Field
|
|
12
|
+
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Settings(BaseSettings):
|
|
16
|
+
"""Runtime settings.
|
|
17
|
+
|
|
18
|
+
新增字段必须:
|
|
19
|
+
- 给默认值(不要让生产环境因缺一个变量启动崩溃)
|
|
20
|
+
- 同步更新根 `.env.example`(如启用 contracts-base fragment)
|
|
21
|
+
- 敏感字段(密钥、token)只能从环境变量读,绝不写默认值
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
model_config = SettingsConfigDict(
|
|
25
|
+
env_file=".env",
|
|
26
|
+
env_file_encoding="utf-8",
|
|
27
|
+
case_sensitive=False,
|
|
28
|
+
extra="ignore",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
app_name: str = Field(default="<%= it.options.projectName %>-server")
|
|
32
|
+
app_version: str = Field(default="0.1.0")
|
|
33
|
+
|
|
34
|
+
# CORS:逗号分隔字符串解析为列表
|
|
35
|
+
cors_allow_origins: list[str] = Field(
|
|
36
|
+
default_factory=lambda: ["http://localhost:5173", "http://localhost:3000"]
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
settings = Settings()
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""<%= it.options.projectName %>-server entry point.
|
|
2
|
+
|
|
3
|
+
Contract First:路由 / 请求体 / 响应体应当与 contracts/openapi/api.yaml 对齐。
|
|
4
|
+
新增端点的工作流见根 AGENTS.md §6(变更分级)+ docs/governance/change-tiers.md:
|
|
5
|
+
端点新增 / 字段新增是 Tier 3,必须先冻结 contracts/openapi/api.yaml 再写实现。
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from collections.abc import AsyncIterator
|
|
9
|
+
from contextlib import asynccontextmanager
|
|
10
|
+
|
|
11
|
+
from fastapi import FastAPI
|
|
12
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
13
|
+
|
|
14
|
+
from .config import settings
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@asynccontextmanager
|
|
18
|
+
async def lifespan(_app: FastAPI) -> AsyncIterator[None]:
|
|
19
|
+
"""启动 / 关闭钩子。
|
|
20
|
+
|
|
21
|
+
在这里做:
|
|
22
|
+
- 数据库连接池初始化(如启用 db)
|
|
23
|
+
- Elasticsearch 客户端初始化(如启用 db=elasticsearch)
|
|
24
|
+
- 后台任务启动
|
|
25
|
+
关闭时反向清理。
|
|
26
|
+
"""
|
|
27
|
+
yield
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
app = FastAPI(
|
|
31
|
+
title=settings.app_name,
|
|
32
|
+
version=settings.app_version,
|
|
33
|
+
description="Generated by @wneng/create-keel; implement per contracts/openapi/api.yaml.",
|
|
34
|
+
lifespan=lifespan,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# CORS — 默认放开本地前端开发常用端口;生产请通过环境变量收紧 allow_origins
|
|
38
|
+
app.add_middleware(
|
|
39
|
+
CORSMiddleware,
|
|
40
|
+
allow_origins=settings.cors_allow_origins,
|
|
41
|
+
allow_credentials=True,
|
|
42
|
+
allow_methods=["*"],
|
|
43
|
+
allow_headers=["*"],
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@app.get("/healthz", tags=["meta"])
|
|
48
|
+
async def healthz() -> dict[str, str]:
|
|
49
|
+
"""Liveness 探针。
|
|
50
|
+
|
|
51
|
+
部署时由 Kubernetes / Docker Compose 周期性调用;返回非 200 即视为不健康。
|
|
52
|
+
"""
|
|
53
|
+
return {"status": "ok"}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@app.get("/", tags=["meta"])
|
|
57
|
+
async def root() -> dict[str, str]:
|
|
58
|
+
return {
|
|
59
|
+
"name": settings.app_name,
|
|
60
|
+
"version": settings.app_version,
|
|
61
|
+
"docs": "/docs",
|
|
62
|
+
}
|
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
name = "<%= it.options.projectName %>-server"
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
requires-python = ">=3.11"
|
|
5
|
-
dependencies = [
|
|
5
|
+
dependencies = [
|
|
6
|
+
"fastapi==0.115.5",
|
|
7
|
+
"uvicorn[standard]==0.32.0",
|
|
8
|
+
"pydantic==2.9.2",
|
|
9
|
+
"pydantic-settings==2.6.1",
|
|
10
|
+
]
|
|
6
11
|
|
|
7
12
|
[project.optional-dependencies]
|
|
8
13
|
dev = [
|
|
9
14
|
"ruff>=0.6.8",
|
|
10
15
|
"mypy>=1.11.0",
|
|
11
16
|
"pytest>=8.3.0",
|
|
17
|
+
"pytest-asyncio>=0.24.0",
|
|
18
|
+
"httpx>=0.27.0",
|
|
12
19
|
"pip-audit>=2.7.0",
|
|
13
20
|
]
|
|
14
21
|
|
|
@@ -47,3 +54,9 @@ exclude = ["generated", ".venv"]
|
|
|
47
54
|
|
|
48
55
|
[tool.pytest.ini_options]
|
|
49
56
|
testpaths = ["tests"]
|
|
57
|
+
asyncio_mode = "auto"
|
|
58
|
+
|
|
59
|
+
# 显式声明应用包,避免 setuptools 把 generated/ 误认为顶层包导致 build error
|
|
60
|
+
[tool.setuptools.packages.find]
|
|
61
|
+
include = ["app*"]
|
|
62
|
+
exclude = ["tests*", "generated*"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Smoke test for the healthz endpoint.
|
|
2
|
+
|
|
3
|
+
CI 跑 `pytest -q` 时会运行;端到端验证:
|
|
4
|
+
- FastAPI app 能 import(语法、依赖、配置都对)
|
|
5
|
+
- lifespan 钩子能起、能落
|
|
6
|
+
- /healthz 返回 200 + {"status": "ok"}
|
|
7
|
+
|
|
8
|
+
新加端点应在 tests/ 下补对应测试;契约级断言(响应 schema 一致性)由
|
|
9
|
+
contracts/tests/contracts/ 下的契约测试覆盖,不在这里重复。
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import pytest
|
|
13
|
+
from httpx import ASGITransport, AsyncClient
|
|
14
|
+
|
|
15
|
+
from app.main import app
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@pytest.mark.asyncio
|
|
19
|
+
async def test_healthz_returns_ok() -> None:
|
|
20
|
+
transport = ASGITransport(app=app)
|
|
21
|
+
async with AsyncClient(transport=transport, base_url="http://test") as client:
|
|
22
|
+
response = await client.get("/healthz")
|
|
23
|
+
assert response.status_code == 200
|
|
24
|
+
assert response.json() == {"status": "ok"}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@pytest.mark.asyncio
|
|
28
|
+
async def test_root_returns_metadata() -> None:
|
|
29
|
+
transport = ASGITransport(app=app)
|
|
30
|
+
async with AsyncClient(transport=transport, base_url="http://test") as client:
|
|
31
|
+
response = await client.get("/")
|
|
32
|
+
assert response.status_code == 200
|
|
33
|
+
body = response.json()
|
|
34
|
+
assert body["name"].endswith("-server")
|
|
35
|
+
assert body["version"] == "0.1.0"
|
|
36
|
+
assert body["docs"] == "/docs"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: server-python
|
|
2
|
-
version: 1.
|
|
2
|
+
version: 1.1.0
|
|
3
3
|
appliesWhen:
|
|
4
4
|
backend: python
|
|
5
5
|
priority: 30
|
|
@@ -12,6 +12,15 @@ files:
|
|
|
12
12
|
render: true
|
|
13
13
|
- from: files/app-init.py
|
|
14
14
|
to: server/app/__init__.py
|
|
15
|
+
render: true
|
|
16
|
+
- from: files/main.py
|
|
17
|
+
to: server/app/main.py
|
|
18
|
+
render: true
|
|
19
|
+
- from: files/config.py
|
|
20
|
+
to: server/app/config.py
|
|
21
|
+
render: true
|
|
22
|
+
- from: files/test_healthz.py
|
|
23
|
+
to: server/tests/test_healthz.py
|
|
15
24
|
render: false
|
|
16
25
|
- from: files/generated-gitkeep
|
|
17
26
|
to: server/generated/.gitkeep
|