当前位置:网站首页>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
边栏推荐
- 什么是消息队列
- 2022.04.23(LC_714_买卖股票的最佳时机含手续费)
- Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
- @Analysis of conditional on Web Application
- PostgreSQL
- ArcMap publishing slicing service
- 命令-sudo
- An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
- C1000k TCP connection upper limit test 1
- Installation, use and problem summary of binlog2sql tool
猜你喜欢
Oracle configuration st_ geometry
MySQL restores or rolls back data through binlog
开关电源设计分享及电源设计技巧图解
[advanced level 11 of C language -- character and string functions and their simulation implementation (2)]
White screen processing method of fulter startup page
Intuitive understanding of the essence of two-dimensional rotation
Getting started with vcpkg
2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
为何PostgreSQL即将超越SQL Server?
Pdf reference learning notes
随机推荐
Strange passion
One stop service platform for high-level talents and development of comprehensive service platform system for talents
Getting started with vcpkg
ArcGIS JS API dojoconfig configuration
Thoughts on the optimization of examination papers in the examination system
First experience of using fluent canvas
openlayers 5.0 加载arcgis server 切片服务
Convert string to JSON
Class loading process of JVM
Application of DCT transform
All table queries and comment description queries of SQL Server
Speculation on the way to realize the smooth drag preview of video editing software
Zlib realizes streaming decompression
2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
redis优化系列(三)解决主从配置后的常见问题
Using Visual Studio code to develop Arduino
js上传文件时控制文件类型和大小
机器学习目录
为何PostgreSQL即将超越SQL Server?
命令-sudo