1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added shortener config for shortener host.

Added another route for shortener host.
This commit is contained in:
Uncled1023 2016-02-21 23:42:38 -08:00
parent 952beef0a2
commit 2d331ddda4
4 changed files with 32 additions and 1 deletions

View File

@ -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 }
);
}
}
}

View File

@ -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();
}

View File

@ -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;
}
}
}

View File

@ -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" />