Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

umi支持启动独立的mock服务吗? #1894

Closed
zhongds opened this issue Jan 22, 2019 · 6 comments
Closed

umi支持启动独立的mock服务吗? #1894

zhongds opened this issue Jan 22, 2019 · 6 comments

Comments

@zhongds
Copy link

zhongds commented Jan 22, 2019

场景:测试环境可能是mock数据和部分真实的api请求并存

目前:打包后的代码运行,mock api就不能用了

需求:能否在现有的mock文件里启动一个mock服务?这样mock api就可以通过nginx代理到mock服务

@zhongds
Copy link
Author

zhongds commented Jan 22, 2019

@sorrycc

@i5ting
Copy link
Member

i5ting commented Jan 23, 2019

umi支持proxy的

@zhongds
Copy link
Author

zhongds commented Jan 23, 2019

umi支持proxy的

这只是webpack-dev-server的功能,,在测试环境一般是用nginx启动服务的吧

@sorrycc
Copy link
Member

sorrycc commented Jan 24, 2019

有想过做,但还没有实现。需要把 mock 中间件提出来,然后实现一个 umi-serve 。

@i5ting
Copy link
Member

i5ting commented Jan 26, 2019

有想过做,但还没有实现。需要把 mock 中间件提出来,然后实现一个 umi-serve 。

  1. 做成一个插件,直接在配置了配置
  2. 插件里注册serve命令,�umi serve。
  3. 纯粹的cli

三合一也不错

@xiaohuoni
Copy link
Member

可以自己简单的实现一个服务 https://github.com/xiaohuoni/antd-pro-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants