Building a Rails App With Multiple Subdomains
In today’s post, we’ll learn how to build a Rails app that can support multiple subdomains. Let’s assume that we have a gaming website funkygames.co and we want to support multiple subdomains such as app.funkygames.co, api.funkygames.co, and dev.funkygames.co with a single Rails application. We want to ensure that proper authentication is performed for all subdomains and that there are no duplicate routes.