Add app.route for mounting extra pages by path.

Register GET routes from assembled pages; sample /about + offline smoke.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-12 08:57:07 +08:00
1 parent 897db76aa7
commit 0dcd9e3d03
9 files changed
+172 -15

No files matched your search

+2 -1
View File
@@ -27,4 +27,5 @@ Offline smokes: `tests/ext/web-smoke.mq.md`, `web-form-smoke.mq.md`, `web-admin-
| Feature | Notes |
|---------|--------|
| Form §5.5 | field/rules tables · `validate` · `submit` · `mount_form` → `GET\|POST /_form/{id}` |
| Admin CRUD | `admin=True` · schema → same form path · new/edit/delete under `/admin/{table}` |
| Admin CRUD | `admin=True` · schema → same form path · new/edit/delete under `/admin/{table}` |
| Route | `` `app`.route path=/about page=`about` `` → `GET /about` |
+5 -3
View File
@@ -174,9 +174,11 @@ Field table + rules table; submit writes through `# db`.
## route
+ `path`
+ `page`=None
+ `page`
**`self`**
Mount an assembled page at `path` (e.g. `/about`). `/` is the home `page=`.
**> web_app_route app=`self` path=`path` page=`page`**
## mount_form
+ `id`
@@ -188,6 +190,6 @@ Register `GET|POST /_form/{id}` for listen.
## listen
Serve `/`, `/_part/{id}`, `/_form/{id}`, and optional `/admin`.
Serve `/`, routed pages, `/_part/{id}`, `/_form/{id}`, and optional `/admin`.
**> web_listen app=`self`**
+4 -2
View File
@@ -166,9 +166,11 @@ description: 官方网站类(中文)。表格 + 方法;不写袋式胶水
## 路由
+ `路径`
+ `页面`=None
+ `页面`
**`self`**
将已装配页面挂到 `路径`(如 `/about`)。`/` 由首页 `页面=` 提供。
**> web_app_route app=`self` path=`路径` page=`页面`**
## 挂载表单
+ `id`