Skip to content
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

feat: modified getMessage to allow setting baseUrl #2391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ukyoda
Copy link

@ukyoda ukyoda commented Dec 12, 2024

I appreciate the availability of this library. Thanks to all the maintainers.

I have been using the getResponse function lately. It is a very useful API, but I thought it would be better if I could also use handlers created with relative paths.

So I would like to add a baseUrl argument to getResponses. I think this can be adapted without causing side-effects, since it just allows existing implementations to be used.

Usage:

const response = await getResponse(
  [http.get('/user', () => Response.json({ name: 'John' }))],
  new Request('http://localhost/user'),
  'http://localhost',
)

If this is not a problem, I would love to have it merged. Please review it.

I am not good at English and I don't have much experience in Contribute to OSS, so I am sorry if I am rude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant