Skip to content

xiaohuoni/antd-pro-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antd-Pro-Serve

antd-pro 的线上 mock 数据,为了 build 之后的展示。

serve start

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"
  },
  ...
]

mock start

npm i antd-pro-server --save

mock.config

比如 .umirc.mock.js

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

About

antd-pro-server mock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published