diff --git a/Teknik/Areas/Shortener/ShortenerAreaRegistration.cs b/Teknik/Areas/Shortener/ShortenerAreaRegistration.cs index 7f9329c..dd86df2 100644 --- a/Teknik/Areas/Shortener/ShortenerAreaRegistration.cs +++ b/Teknik/Areas/Shortener/ShortenerAreaRegistration.cs @@ -18,13 +18,21 @@ namespace Teknik.Areas.Shortener { Config config = Config.Load(); context.MapSubdomainRoute( - "Stream.Index", // Route name + "Shortener.Index", // Route name new List() { "dev", "shorten", "s" }, // Subdomains new List() { config.Host }, // domains "", // URL with parameters new { controller = "Shortener", action = "Index" }, // Parameter defaults new[] { typeof(Controllers.ShortenerController).Namespace } ); + context.MapSubdomainRoute( + "Shortener.View", // Route name + new List() { "dev", "*" }, // Subdomains + new List() { config.ShortenerConfig.ShortenerHost }, // domains + "", // URL with parameters + new { controller = "Shortener", action = "View" }, // Parameter defaults + new[] { typeof(Controllers.ShortenerController).Namespace } + ); } } } \ No newline at end of file diff --git a/Teknik/Configuration/Config.cs b/Teknik/Configuration/Config.cs index 7feac39..0e95b60 100644 --- a/Teknik/Configuration/Config.cs +++ b/Teknik/Configuration/Config.cs @@ -32,6 +32,7 @@ namespace Teknik.Configuration private ApiConfig _ApiConfig; private PodcastConfig _PodcastConfig; private StreamConfig _StreamConfig; + private ShortenerConfig _ShortenerConfig; private DatabaseConfig _DatabaseConfig; public bool DevEnvironment { get { return _DevEnvironment; } set { _DevEnvironment = value; } } @@ -77,6 +78,9 @@ namespace Teknik.Configuration // Stream Configuration public StreamConfig StreamConfig { get { return _StreamConfig; } set { _StreamConfig = value; } } + // Shortener Configuration + public ShortenerConfig ShortenerConfig { get { return _ShortenerConfig; } set { _ShortenerConfig = value; } } + // Database Configuration public DatabaseConfig DatabaseConfig { get { return _DatabaseConfig; } set { _DatabaseConfig = value; } } @@ -112,6 +116,7 @@ namespace Teknik.Configuration ApiConfig = new ApiConfig(); PodcastConfig = new PodcastConfig(); StreamConfig = new StreamConfig(); + ShortenerConfig = new ShortenerConfig(); DatabaseConfig = new DatabaseConfig(); } diff --git a/Teknik/Configuration/ShortenerConfig.cs b/Teknik/Configuration/ShortenerConfig.cs new file mode 100644 index 0000000..8f1ff24 --- /dev/null +++ b/Teknik/Configuration/ShortenerConfig.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace Teknik.Configuration +{ + public class ShortenerConfig + { + public string ShortenerHost { get; set; } + + public ShortenerConfig() + { + ShortenerHost = string.Empty; + } + } +} \ No newline at end of file diff --git a/Teknik/Teknik.csproj b/Teknik/Teknik.csproj index 23b037e..24f64d9 100644 --- a/Teknik/Teknik.csproj +++ b/Teknik/Teknik.csproj @@ -228,6 +228,7 @@ +