Closed matheusfrancisco closed 5 months ago
There is nothing built-in, but you can build this easily on top of reitit. e.g.
:host
and :schema
keys from route data. see parameter coercion middleware as example, e.g. either needs to needs to be set for the middleware to mount into to the route[["" {:host "example.com"} ...]
["/all-hosts"
["/trade" {:host "trade.com"} ...]
["/api"
["/admin" {:host "admin.com" :scheme :https} ...]
["/public" {:host "public.com"} ...]]]]
it might not be a use case for an example here in reitit but I will put my repo here https://github.com/matheusfrancisco/multihost-reitit-pedestal with the interceptor that work for simple case, than I will do a complex case and migrate the moclojer https://github.com/moclojer/moclojer for reitit thanks for your support @ikitommi if you want you can close this issue
I did found on the documentation anything about do a multiple host routes. I would like to do a set of routes to when I hit
api.xpto.com
it will redirect to be available some set of routes, and when I hitapi2.xpto.com
it will be available another set of routes.Currently, I have an application running in production with pedestal routes, so I was switching to reitit, but I miss this feature, if is something you guys would like to have or any suggestion I'm willing to open a pull request or something.