-
Notifications
You must be signed in to change notification settings - Fork 128
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: Support option to access req.headers.host in dynamic routes function #218
base: dev
Are you sure you want to change the base?
Conversation
I'd like this aswell, I've used your "hacky" solution, works perfect. |
Do you mind taking a look at it @NicoPennec ? |
in your commit it is necessary to restore the 25th line |
Thanks for pointing it out. Corrected it now. One can see that this is my first PR as the commit doesn't seem to go through the checks either 😬 |
@NicoPennec could you check this PR please? |
Is this going to get picked up someday? |
we need this feature |
This PR allows you to access req.headers.host when dynamically generating routes as requested in #217 #216 #215 #11
✨ Helpful for multi-tenant projects where the subdomain is needed to identify a user [user].maindomain.com
In order to use it the
dynamicHost
option must be enabled. Then thehost
parameter is available to be used in the routes function.See example:
––––––––––––-
This is my first PR ever on Github and the solution is quite hacky – so please take it with a grain of salt and see it more as an inspiration on how this functionality could be achieved.