当前位置:网站首页>Easy mock local deployment (you need to experience three times in a crowded time. Li Zao will do the same as me. Love is like a festival mock)
Easy mock local deployment (you need to experience three times in a crowded time. Li Zao will do the same as me. Love is like a festival mock)
2022-04-23 19:19:00 【"Technology makes customers"】
Preface
Many little partners asked me how to add configuration to my company's projects mock, stay vue Everyone in the project knows how to configure mock, In large-scale front-end projects, I was confused .
I'll answer him , You'll be here today vue In the project , I changed the company that day with angular、react,webix… wait
Still not configured to use mock, It's recommended easymock,
All front-end projects can be used, whatever you jb frame , It's all done ojbk. Someone asked ,easymock, Why deploy locally , Can't you use it online ?( Of course. , Everything you say is right )
There are several reasons
- 1 easymock The official website often hangs , Cause development progress to stop ( If you can't finish the task, wait for overtime )
- 2 Some partners are outsourcing companies , You can't use the Internet (mmp There is no Internet , How do I Google program ?)
- 3 In case of that day easymock Lost your important information ( It's no use suing him )
Quick start ( The bus to kindergarten is leaving , Get in the car and fasten your seat belt )
Before we start , Suppose you have successfully installed Node.js(>= v8.9)& MongoDB(>= v3.4)& Redis(>= v4.0).
MongoDB Installation tutorial :http://www.runoob.com/mongodb/mongodb-window-install.html
Redis Installation tutorial :http://www.runoob.com/redis/redis-install.html
tips tip
- node.js and mongodb When installing, it is always next Just go down .
- redis It's a compressed package , Just unzip it
Check if the installation is successful
- node.js It works npm It was successful , Or output node edition
- mongodb Find the installed folder ( Generally, the default is
C:\Program Files\MongoDB\Server\4.0\bin
Inside ), double-click mongo.exe Input db Carriage return display test The database is successful
- redis Check whether it is successful. See the installation tutorial above for a very simple .
install
$ git clone https://github.com/easy-mock/easy-mock.git
$ cd easy-mock && npm install
The configuration file
find config/default.json, Or create a config/local.json file , Replace the following fields to be replaced with your own configuration .( By default, the configuration file does not need to be modified )
Different environments will load different configuration files , Before that, you should be right node-config Know something about .
{
"port": 7300,//easymock Project start port
"host": "0.0.0.0",
"pageSize": 30,
"proxy": false,
"db": "mongodb://localhost/easy-mock",// You don't need to create your own database , Starting easymock Just create a new interface
"unsplashClientId": "",
"redis": {
"port": 6379,//redis port
"host": "localhost"
},
"blackList": {
"projects": [], // projectId, example :"5a4495e16ef711102113e500"
"ips": [] // ip, example :"127.0.0.1"
},
"rateLimit": { // https://github.com/koajs/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
}
},
"fe": {
"copyright": "",
"storageNamespace": "easy-mock_",
"timeout": 25000,
"publicPath": "/dist/"
}
}
start-up
$ npm run dev
# visit http://127.0.0.1:7300
At this time, we can open an interface preview at random , Copy url use postman Test interface ok
More requirements configuration , See the official website for details , I don't want more Once said .
Vue Study Group 493671066, Many beauties . Old driver, get in the car , It's too late to explain .
Author correlation Vue article
be based on Vue2.0 Realize the authority control of background system
vue2.0- be based on elementui Skin peeler [ Custom theme ]
VUE2.0 Add, delete, change, check, attach, edit, add model( bounced ) Component sharing
Reward Heartfelt thanks
版权声明
本文为["Technology makes customers"]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210559121080.html
边栏推荐
- Data analysis learning directory
- 腾讯云GPU最佳实践-使用jupyter pycharm远程开发训练
- Installation, use and problem summary of binlog2sql tool
- arcMap 发布切片服务
- openlayers 5.0 加载arcgis server 切片服务
- Use of fluent custom fonts and pictures
- Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
- The platinum library cannot search the debug process records of some projection devices
- Disable Ctrl + Alt + Del
- 在渤海期货办理开户安全吗。
猜你喜欢
Use of fluent custom fonts and pictures
binlog2sql 工具安装使用及问题汇总
2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
浅谈c语言指针的强制转换
Openharmony open source developer growth plan, looking for new open source forces that change the world!
【C语言进阶11——字符和字符串函数及其模拟实现(2))】
Getting started with vcpkg
Client interns of a large factory share their experience face to face
2022.04.23 (the best time for lc_714_to buy and sell stocks, including handling charges)
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
随机推荐
openlayers 5.0 加载arcgis server 切片服务
I just want to leave a note for myself
Pdf reference learning notes
開關電源設計分享及電源設計技巧圖解
An example of using JNI to directly access surface data
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
JVM的类加载过程
Some records used by VS2010
The platinum library cannot search the debug process records of some projection devices
SQL server requires to query the information of all employees with surname 'Wang'
The flyer realizes page Jump through routing routes
Zlib realizes streaming decompression
Intuitive understanding of the essence of two-dimensional rotation
Minesweeping II of souI instance
2022.04.23 (lc_763_divided into letter interval)
考试系统进入试卷优化思路
Disable Ctrl + Alt + Del
Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
Oracle配置st_geometry