Replies: 3 comments 5 replies
-
This is a great suggestion and I think we should definitely make it an option. Not sure when we can get to it, but it'd be very cool. I'm imagining something like this: class Blog::Posts::Index < BrowserAction
route_constraints subdomain: "blog"
get "/posts" do
end
end Or to share this between actions, create a abstract class BlogAction < BrowserAction
route_constraints subdomain: "blog"
end
class Blog::Posts::Index < BlogAction
# Do your thing
end I think this API would be nice. It would require some changes to the route handler so that it uses a different router for different domains or something, but we can figure out how it works later. Thoughts @watzon, @jwoertink? EDIT: We can also add stuff to route constraints to do something like Rails where you can give it a class and do all kinds of fancy stuff...but we can figure that out separately |
Beta Was this translation helpful? Give feedback.
-
That would be amazing! At some point in the next few months, we will need this. Our api will need to be on a dedicated subdomain for example. So I would be happy to help out. |
Beta Was this translation helpful? Give feedback.
-
Oh and regarding the route name spacing, I think we should add a “route_prefix” macro that will prefix the routes with whatever you give it. That’ll help with /admin and /api/v1 type namespaces |
Beta Was this translation helpful? Give feedback.
-
It would be nice to eventually be able to tell certain actions that they are within a namespace, and set everything attached to that namespace to a specific route or subdomain.
For instance, say I have a site that contains the action namespaces
home
,blog
, anddashboard
. Currently you can pretty easily designate them to the route prefixes/
,/blog
, and/dashboard
, but it would be nice to be able to instead haveblog
anddashboard
forward to the subdmomains of the same name.With rails this can be done with constraints
As far as how to do this best in Lucky, I don't know. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions