拥有始终以HTTP 200响应的服务器的最简单方法
我正在使用多个微服务,有时我只想忽略微服务,然后用服务器替换它,该服务器将始终以HTTP 200响应任何请求。
根据任何请求,我的意思是每种类型的请求(post,get,patch ..),并在服务器上和域的任何路由上制作的任何车身或标头(例如server.dev/somewhere
, server.dev/another/endpoint
)
您知道有任何现有网站吗?
是否有一种简单/快速运行最小的服务器可以在本地执行此操作的方法?
显然,这仅适用于我的开发环境,我不需要在生产中使用它。
I'm working with multiple microservices, and sometimes I just want to ignore a microservice and replace it by a server that will always respond with HTTP 200 for any request.
By any request, I mean every type of requests (POST, GET, PATCH ..) with any body or header made on the server and on any route of the domain (e.g. server.dev/somewhere
, server.dev/another/endpoint
)
Do you know any existing website that does that ?
Is there an easy/fast way to run a minimal server that would do that locally ?
Obviously, it's just for my development environment, I don't need to use this in production.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种简单的方法是用 node.js
简单的内容:
上面在端口4000上听,可以在http:// localhost:4000/可以访问
One easy way to do this is with node.js
Something as simple as:
The above listens on port 4000 and would be accessable at http://localhost:4000/