Building a Rails App With Multiple Subdomains

Time to read
less than
1 minute
Read so far

Building a Rails App With Multiple Subdomains

Wed, 04/03/2020 - 09:00
appsignal

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. We’ll use Rails’ powerful routing constructs to support multiple subdomains in our application. We’ll also set up subdomains locally and write tests for multiple subdomains.