-
-
Notifications
You must be signed in to change notification settings - Fork 320
-
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
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.
All reactions
-
I'm afraid I have not. I went back and looked at what I think was the web component I was working on at the time, just to see, other people have worked on it in the mean time but I don't think we ever figured anything out.
It sounds like you got further than I did.
Beta Was this translation helpful? Give feedback.