Git Product home page Git Product logo

Comments (12)

wuomzfx avatar wuomzfx commented on August 15, 2024 4

@helloxdan 目前还没有,如果您在这方面有急迫的需求话,可以自己定制一下,请求特定的mock地址加上参数,如:http://api-mocker.com/mock-data?url=/module1/api1 ,然后mocker后端根据这个url参数对数据库中的api 的线上地址 和 测试地址 进行模糊匹配,获取到第一个 接口即为 mock接口 ,然后执行后续操作

from api-mocker.

wuomzfx avatar wuomzfx commented on August 15, 2024

嗯,一直有考虑,就是没找到比较好的交互方式来添加这个功能,同时还需要考虑接口url重复等带来的问题,我最近找时间看看,尽快加上这个功能。谢谢您的反馈~

from api-mocker.

includeleec avatar includeleec commented on August 15, 2024

线上地址、测试地址可以写个map文件对应起来。

from api-mocker.

wuomzfx avatar wuomzfx commented on August 15, 2024

对的,我这边目前就是自己有专门的文件负责暴露接口,根据环境判断选取测试地址、线上地址、mock地址

from api-mocker.

wuomzfx avatar wuomzfx commented on August 15, 2024

如果有在部署使用的话,欢迎加入api mocker使用交流群~

wechatimg193

from api-mocker.

thecreation avatar thecreation commented on August 15, 2024

二维码过期了。求更新。

from api-mocker.

wuomzfx avatar wuomzfx commented on August 15, 2024

@amazingSurge 已更新

from api-mocker.

heibai01 avatar heibai01 commented on August 15, 2024

这个提议也是我想说的。交互方式可以参照postman,有个全局变量的设置。
比如我的接口地址是:{{project_domain}}/users
project_domain 对应几个值,比如Mock服务地址、Test地址、Production地址

from api-mocker.

heibai01 avatar heibai01 commented on August 15, 2024

然后是迫切希望增加一个请求方式:PATCH。

  • PATCH一般用于资源的部分更新,而PUT一般用于资源的整体更新。
  • 当资源不存在时,PATCH会创建一个新的资源,而PUT只会对已在资源进行更新。

甚至可以加更多,照HTTP协议加。。。

from api-mocker.

wuomzfx avatar wuomzfx commented on August 15, 2024

@heibai01 增加patch了, 5956d5d
重新拉取下代码就好了,之前有个 配置文件 我也有调整,如果拉取过程中,配置文件有冲突,建议先备份一下自己的配置文件

from api-mocker.

helloxdan avatar helloxdan commented on August 15, 2024

随机生成的url,客户端调用这样一个没有标识意义的字符串,很难管理啊。有解决方案了没?

from api-mocker.

lusq010 avatar lusq010 commented on August 15, 2024

main分支新版本中已强化了api路径的概念,通过 应用(hash) + 接口路径 + 请求方法 作为api唯一标识,从而解决mock api与真实接口路径不一致的问题,调用方在同一应用中调用不同环境的api只需要切换不同的baseUrl即可;同时解决了hash模式下api语义丢失问题

from api-mocker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.