Custom domains and SSL in Rails development - Avo
30-May-2025 23
There's nothing wrong with the traditional Rails approach of starting the server using rails server or bin/dev and navigating to localhost:3000.
But there are some cases where having a custom domain name, even for local development, can be useful:
Working with subdomains: route constraints can help us work with subdomains, but browser session cookies are domain-scoped. This means that api.localhost:3001 and localhost:3000 are considered different domains, which means that cookies won't be shared between them in case we need it.
Development and production parity: having parity between development and production is generally desirable. Of course, SSL is just one part of the equation, but it can help us discover issues before our customers do. Things like CORS or secure cookies are better tested with custom and secure local domains.
Custom domains and SSL in Rails development - Avo #ruby #rubydeveloper #rubyonrails #Custom #domains #Rails #development #development https://rubyonrails.ba/link/custom-domains-and-ssl-in-rails-development-avo