1.0.9 • Published 4 years ago

maxs-mock v1.0.9

Weekly downloads
10
License
ISC
Repository
-
Last release
4 years ago

maxs-mock

安装

npm install --save-dev maxs-mock

使用说明
  1. 安装依赖包之后,在项目package.json

  2. 若要是用本地mock,其中mockConfig是配置文件

    • "scripts": {
      • ...
      • "mock": "cross-env mockConfig=mock.config.js maxs-mock ",
    • },
  3. 若要使用代理服务, 需配置mode对方服务器ip

  4. 两种都配置

    • "scripts": {
      • ...
      • "mock": "cross-env mockConfig=mock.config.js maxs-mock ",
      • "proxy": "cross-env mode=http://localhost:6666 maxs-mock "
    • },
  5. mock.config.js中

    • module.exports = {
      • /* 启动服务时,获取给定的端口 /
      • apiPort: 8000,
      • /* 启动服务时,传入的文件路径 /
      • apiPath: 'mocks',
      • /* 启动服务时,是否查询子目录 默认false /
      • apiIsSubDir: true,
      • /* 启动服务时,文件匹配规则 默认匹配规则为/.mock.js$/ /
      • apiRegExp: /.mock.js$/
    • };
1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago