API Mocks
#1437
Replies: 1 comment 1 reply
-
Hello! Do you have any update or have you found any solution on this? I have some middleware that serves json files well for web-dev-server, but I can't figure out why it doesn't work for the test runner. I get 404 when I try to call the same mock APIs from web-test-runner. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi there
I'm setting up
@web/dev-server
for a small-ish project that used webpack before. I'm trying to figure out the best way to hook up some mock API responses.I've tried using a middleware proxy but, I'm not sure exactly what I want. It looks very straight forward to send (some) requests (based on the pattern of the URL) to a different server. However what I want to do seems like it's simpler, which is just server up json files.
I've tried rewriting the requests, but I'm getting errors about changing headers after the body had already been sent.
I think I could figure out a solution to this using some KOA middleware, but it all seem more complicated than it should be.
Does anyone have an example handy they could point me to?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions