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

hostname routing #3

Open
1 of 2 tasks
lukeed opened this issue Mar 10, 2021 · 4 comments
Open
1 of 2 tasks

hostname routing #3

lukeed opened this issue Mar 10, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request feedback wanted

Comments

@lukeed
Copy link
Owner

lukeed commented Mar 10, 2021

The idea is to allow the same worker to service multiple domains ("zones"). Through Worker Routes, there's no reason why you can't/shouldn't be able to do this in a real application.

And with SSL for SaaS, this may be way more common.

  • add hostname to request data
  • add App.host('example.com').add('GET', '/foo', handler) API
@lukeed lukeed added the enhancement New feature or request label Mar 10, 2021
@lukeed lukeed self-assigned this Mar 10, 2021
@lukeed
Copy link
Owner Author

lukeed commented Mar 11, 2021

Should also maybe allow host() to accept a pattern?

App.host(':service.example.com').get('/greet/:name', (req, res) => {
  const { service, name } = req.params;
  res.end(`hello ${name}, you are on the ${service} portal!`);
});

lukeed added a commit that referenced this issue Mar 11, 2021
@itsmatteomanf
Copy link

Should also maybe allow host() to accept a pattern?

App.host(':service.example.com').get('/greet/:name', (req, res) => {
  const { service, name } = req.params;
  res.end(`hello ${name}, you are on the ${service} portal!`);
});

This would be great for enterprise zones, which can proxy wildcards.

@lukeed lukeed removed the maybe label Mar 17, 2021
@helloimalastair
Copy link

Can't wait for this, so I can finally clean up my mega-worker!

@c0b41
Copy link

c0b41 commented Oct 18, 2022

any progress for this feature? this feature can be soo usefull for reverse proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feedback wanted
Projects
None yet
Development

No branches or pull requests

4 participants