美文网首页
EasyMock的安装与部署-windows

EasyMock的安装与部署-windows

作者: wh17292 | 来源:发表于2020-06-09 12:51 被阅读0次

    源代码和依赖的下载

    $ git clone https://github.com/easy-mock/easy-mock.git
    $ cd easy-mock && npm install
    

    修改配置文件

    {
      "port": 7300,
      "host": "本机IP",
      "pageSize": 30,
      "proxy": false,
      "db": "mongodb://localhost/easy-mock",
      "unsplashClientId": "",
      "redis": {
        "keyPrefix": "[Easy Mock]",
        "port": 6379,
        "host": "localhost",
        "password": "",
        "db": 0
      },
      "blackList": {
        "projects": [],
        "ips": []
      },
      "rateLimit": {
        "max": 1000,
        "duration": 1000
      },
      "jwt": {
        "expire": "14 days",
        "secret": "shared-secret"
      },
      "upload": {
        "types": [".jpg", ".jpeg", ".png", ".gif", ".json", ".yml", ".yaml"],
        "size": 5242880,
        "dir": "../public/upload",
        "expire": {
          "types": [".json", ".yml", ".yaml"],
          "day": -1
        }
      },
      "ldap": {
        "server": "",
        "bindDN": "",
        "password": "",
        "filter": {
          "base": "",
          "attributeName": ""
        }
      },
      "fe": {
        "copyright": "",
        "storageNamespace": "easy-mock_",
        "timeout": 25000,
        "publicPath": "/dist/"
      }
    }
    
    

    测试启动

    此方式只是为了验证是否部署成功,这种方式会在终端关闭之后停掉服务,所以使用本地部署,还需要进行下面的操作。

    $ npm run dev
    # 访问 http://127.0.0.1:7300
    
    测试启动.png

    直接登录并且选择创建用户(密码不可修改)


    创建用户.png

    创建完成,进入项目。


    创建完成.png

    本地部署启动

    1. 前端静态资源构建打包
    $ npm run build
    
    1. pm2 安装以及windows开机自启动

    相关文章

      网友评论

          本文标题:EasyMock的安装与部署-windows

          本文链接:https://www.haomeiwen.com/subject/obsstktx.html