Browse Source

Added shortener config for shortener host.

Added another route for shortener host.
tags/2.0.3
Teknikode 4 years ago
parent
commit
2d331ddda4

+ 9
- 1
Teknik/Areas/Shortener/ShortenerAreaRegistration.cs 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 }
);
}
}
}

+ 5
- 0
Teknik/Configuration/Config.cs 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();
}


+ 17
- 0
Teknik/Configuration/ShortenerConfig.cs 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;
}
}
}

+ 1
- 0
Teknik/Teknik.csproj 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" />

Loading…
Cancel
Save