diff --git a/config/config.exs b/config/config.exs index b63b4703d7..fa13f20aa4 100644 --- a/config/config.exs +++ b/config/config.exs @@ -30,6 +30,13 @@ config :dotcom, :redix_pub_sub, Redix.PubSub config :dotcom, :otp_module, OpenTripPlannerClient config :dotcom, :req_module, Req +tile_server_url = + if config_env() == :prod, + do: "https://cdn.mbta.com", + else: "https://mbta-map-tiles-dev.s3.amazonaws.com" + +config :dotcom, tile_server_url: tile_server_url + config :sentry, enable_source_code_context: true, root_source_code_paths: [File.cwd!()], @@ -50,7 +57,7 @@ config :mbta_metro, :map, %{ "sources" => %{ "raster-tiles" => %{ "type" => "raster", - "tiles" => ["https://mbta-map-tiles-dev.s3.amazonaws.com/osm_tiles/{z}/{x}/{y}.png"], + "tiles" => ["#{tile_server_url}/osm_tiles/{z}/{x}/{y}.png"], "tileSize" => 256, "attribution" => "© OpenStreetMap" diff --git a/config/dotcom/dotcom.exs b/config/dotcom/dotcom.exs index 25621e3bcf..c42338f0b3 100644 --- a/config/dotcom/dotcom.exs +++ b/config/dotcom/dotcom.exs @@ -8,13 +8,6 @@ config :dotcom, start_data_processes: config_env() != :test config :dotcom, Dotcom.BodyTag, mticket_header: "x-mticket" -tile_server_url = - if config_env() == :prod, - do: "https://cdn.mbta.com", - else: "https://mbta-map-tiles-dev.s3.amazonaws.com" - -config :dotcom, tile_server_url: tile_server_url - response_fn = if config_env() == :prod, do: {DotcomWeb.StaticFileController, :redirect_through_cdn},