antd-pro 的线上 mock 数据,为了 build 之后的展示。
git clone https://github.com/xiaohuoni/antd-pro-server.git
npm i
npm start
http://localhost:3000/api/users
[
{
"key": "1",
"name": "John Brown",
"age": 32,
"address": "New York No. 1 Lake Park"
},
...
]
npm i antd-pro-server --save
mock.config
import proxy from "antd-pro-server";
export default proxy;
import antdServer from "antd-pro-server";
const proxy = {
"GET /api/test": [
{
code: "success",
message: "成功"
}
]
};
export default { ...proxy, ...antdServer };
http://localhost:8000/api/test
[{"code":"success","message":"成功"}]
cross-env MOCK=none umi dev