-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
docs: url without pathName on server listen #266
base: main
Are you sure you want to change the base?
Conversation
@reslear is attempting to deploy a commit to the MSW Team on Vercel. A member of the Team first needs to authorize it. |
} | ||
|
||
// Skip non-server API requests | ||
if (url.origin !== process.env.API_URL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this from the example, it's too specific. It relies on the user having the API_URL
env variable and even being familiar with the concept of env variables. Let's keep the example to the necessary minimum 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just saw your example with env variable
if (process.env.NODE_ENV !== 'development') { |
I have other requests running on the server that don't need to be mocked, i believe that if this example had been and indexed by search, I wouldn't have spent 15 minutes looking for how to do it in issue :)
what if we moved it to faq with our h2 title like - "How to control or manage requests to different domains" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A great improvement! Just one comment about keeping the example to the minimum.
request.url
is string notURL
constructor :)I also added a useful example (like mswjs/msw#1636 (reply in thread)) so you don't have to search for it