Added another route for shortener host.tags/2.0.3
@@ -18,13 +18,21 @@ namespace Teknik.Areas.Shortener | |||
{ | |||
Config config = Config.Load(); | |||
context.MapSubdomainRoute( | |||
"Stream.Index", // Route name | |||
"Shortener.Index", // Route name | |||
new List<string>() { "dev", "shorten", "s" }, // Subdomains | |||
new List<string>() { 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<string>() { "dev", "*" }, // Subdomains | |||
new List<string>() { config.ShortenerConfig.ShortenerHost }, // domains | |||
"", // URL with parameters | |||
new { controller = "Shortener", action = "View" }, // Parameter defaults | |||
new[] { typeof(Controllers.ShortenerController).Namespace } | |||
); | |||
} | |||
} | |||
} |
@@ -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(); | |||
} | |||
@@ -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; | |||
} | |||
} | |||
} |
@@ -228,6 +228,7 @@ | |||
<Compile Include="Areas\Upload\ViewModels\DeleteViewModel.cs" /> | |||
<Compile Include="Areas\Upload\ViewModels\DownloadViewModel.cs" /> | |||
<Compile Include="Areas\Upload\ViewModels\UploadViewModel.cs" /> | |||
<Compile Include="Configuration\ShortenerConfig.cs" /> | |||
<Compile Include="Configuration\StreamConfig.cs" /> | |||
<Compile Include="Configuration\ApiConfig.cs" /> | |||
<Compile Include="Configuration\DatabaseConfig.cs" /> |