This project is archived and is in readonly mode.
defining subdomain constraints in router with various TLD lengths
-
Andrew White
- Milestone cleared.
- State changed from new to open
- Assigned user set to Andrew White
- Importance changed from to Low
Not sure about adding another global config option but as a workaround you can do the following:
constraints{ |req| req.subdomain(req.host == 'localhost' ? 0 : 2) == 'api' } do ... end -
Andrew White
Another workaround would be to use a regexp and host:
constraints :host => /^api\.(localhost|rubyonrails\.org\.uk)$/ do ... end -
Andrew White
- State changed from open to wontfix