To get TLD-based routing to work on a local machine, edit your /etc/hosts
:
127.0.0.1 somedomain.com somedomain.co.uk
Then start the app:
bundle exec bin/rails server -p 7272
And visit the appropriate domain, e.g. http://somedomain.com:7272
to view the US "site", http://somedomain.co.uk:7272
for the UK "site".
Uses Rails 5 w/ built-in webpack/react support, i.e. webpacker
and react-rails
.
- The Rails router routes to the appropriate controller here.
- The region-specific controllers (us & uk) are no-op, simply rendering a "static" (from the Rails perspective) view.
- The region-specific views render region-specific React-components:
- The US view renders a top-level
UsGateway
component- The
UsGateway
component renders:- the plain-jane
Gateway
and - a plain-jane
Registration
components.
- the plain-jane
- The
- The UK view renders a top-level
UkGateway
component- The
UkGateway
component renders:
- The
- The US view renders a top-level
- The
Gateway
andRegistration
components are standalone.