chore: 删除 examples/ — git+http install 会把它一起拖给消费方
包内自带的 Vue demo 不是 shrimp 框架的一部分,git+http 安装时 `files: [...]` 不生效,examples/(尤其 web/ Vue 子项目)会进消费方 node_modules,污染 install 体积并触发 tsc 噪音。 完整接入示例去 hand-server-2 主项目看;basic-admin 那种零依赖 demo 可以以后单独 pin 在 docs/ 或独立仓库。
This commit is contained in:
@@ -2,16 +2,6 @@
|
||||
|
||||
声明式字段驱动的 Node.js 后台管理框架(Express + Mongoose + JWT)。后台只声明"表 + 字段",前端自动渲染表格、表单、搜索、菜单。
|
||||
|
||||
## 快速跑通(不需要 MongoDB)
|
||||
|
||||
```sh
|
||||
git clone http://git.zeromvc.com/wc24/shrimp-server.git
|
||||
cd shrimp-server
|
||||
npm install
|
||||
cd examples/basic-admin && npm install && npm start
|
||||
# 另一窗口 curl http://localhost:3100/api/product/list -X POST -d '[{}]' -H 'content-type: application/json'
|
||||
```
|
||||
|
||||
## 在你的项目里用
|
||||
|
||||
```sh
|
||||
@@ -611,15 +601,7 @@ class MyAdmin extends ShrimpServer {
|
||||
|
||||
---
|
||||
|
||||
## 14. 完整接入示例
|
||||
|
||||
参考本仓库:
|
||||
- [examples/basic-admin/index.ts](examples/basic-admin/index.ts) — 零 Mongo 依赖,用 MemoryShrimpCrud 跑起一个 admin
|
||||
- [examples/basic-admin/README.md](examples/basic-admin/README.md) — curl 示例 + 跑法
|
||||
|
||||
---
|
||||
|
||||
## 15. 常见踩坑
|
||||
## 14. 常见踩坑
|
||||
|
||||
- **`relation.moduleKey` 必须能在 crudRegistry 找到。** 如果改成了非默认数据源,确认 `(dataSource as any).model` 存在,否则自动 populate 不生效。
|
||||
- **`searchable` 只对字符串型字段生效。** 关键词搜索走 LIKE,数字/布尔字段加了也没用,要做精确筛选用 `filterable`。
|
||||
|
||||
Reference in New Issue
Block a user