DEV Community

Discussion on: Building a Rails App With Multiple Subdomains

Collapse
 
cescquintero profile image
Francisco Quintero 🇨🇴

Wow, this is such a new approach to use subdomain constraint. I've always used it like this when building APIs:

namespace 'api', defaults: { format: 'json' }, constraints: { subdomain: /api/ }, path: '/' do
  # routes
end
Enter fullscreen mode Exit fullscreen mode

and always forced myself to go this way when having multiple subdomains. Good to know there're more ways to do this!

Thanks for sharing :D