The next generation of the Teknik Services. Written in ASP.NET.
https://www.teknik.io/
25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.4 KiB
63 lines
2.4 KiB
using System.Collections.Generic; |
|
using System.Web.Mvc; |
|
using System.Web.Optimization; |
|
using Teknik; |
|
using Teknik.Configuration; |
|
using Teknik.Controllers; |
|
|
|
namespace Teknik.Areas.Home |
|
{ |
|
public class HomeAreaRegistration : AreaRegistration |
|
{ |
|
public override string AreaName |
|
{ |
|
get |
|
{ |
|
return "Home"; |
|
} |
|
} |
|
|
|
public override void RegisterArea(AreaRegistrationContext context) |
|
{ |
|
Config config = Config.Load(); |
|
|
|
// Default Routes to be applied everywhere |
|
context.MapSubdomainRoute( |
|
"Default.Favicon", // Route name |
|
new List<string>() { "*" }, // Subdomains |
|
new List<string>() { config.Host, config.ShortenerConfig.ShortenerHost }, // domains |
|
"favicon.ico", // URL with parameters |
|
new { controller = "Default", action = "Favicon" }, // Parameter defaults |
|
new[] { typeof(DefaultController).Namespace } |
|
); |
|
|
|
// Default Routes to be applied everywhere |
|
context.MapSubdomainRoute( |
|
"Default.Logo", // Route name |
|
new List<string>() { "*" }, // Subdomains |
|
new List<string>() { config.Host, config.ShortenerConfig.ShortenerHost }, // domains |
|
"Logo", // URL with parameters |
|
new { controller = "Default", action = "Logo" }, // Parameter defaults |
|
new[] { typeof(DefaultController).Namespace } |
|
); |
|
|
|
context.MapSubdomainRoute( |
|
"Home.Index", // Route name |
|
new List<string>() { "www", string.Empty }, // Subdomains |
|
new List<string>() { config.Host }, // domains |
|
"", // URL with parameters |
|
new { controller = "Home", action = "Index" }, // Parameter defaults |
|
new[] { typeof(Controllers.HomeController).Namespace } |
|
); |
|
|
|
// Register Style Bundles |
|
BundleTable.Bundles.Add(new StyleBundle("~/Content/home").Include( |
|
"~/Areas/Home/Content/Home.css")); |
|
|
|
// Register Script Bundles |
|
BundleTable.Bundles.Add(new ScriptBundle("~/bundles/home").Include( |
|
"~/Scripts/PageDown/Markdown.Converter.js", |
|
"~/Scripts/PageDown/Markdown.Sanitizer.js")); |
|
} |
|
} |
|
} |