The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HomeAreaRegistration.cs 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. using Teknik;
  5. using Teknik.Configuration;
  6. using Teknik.Controllers;
  7. namespace Teknik.Areas.Home
  8. {
  9. public class HomeAreaRegistration : AreaRegistration
  10. {
  11. public override string AreaName
  12. {
  13. get
  14. {
  15. return "Home";
  16. }
  17. }
  18. public override void RegisterArea(AreaRegistrationContext context)
  19. {
  20. Config config = Config.Load();
  21. // Default Routes to be applied everywhere
  22. context.MapSubdomainRoute(
  23. "Default.Favicon", // Route name
  24. new List<string>() { "*" }, // Subdomains
  25. new List<string>() { config.Host, config.ShortenerConfig.ShortenerHost }, // domains
  26. "favicon.ico", // URL with parameters
  27. new { controller = "Default", action = "Favicon" }, // Parameter defaults
  28. new[] { typeof(DefaultController).Namespace }
  29. );
  30. // Default Routes to be applied everywhere
  31. context.MapSubdomainRoute(
  32. "Default.Logo", // Route name
  33. new List<string>() { "*" }, // Subdomains
  34. new List<string>() { config.Host, config.ShortenerConfig.ShortenerHost }, // domains
  35. "Logo", // URL with parameters
  36. new { controller = "Default", action = "Logo" }, // Parameter defaults
  37. new[] { typeof(DefaultController).Namespace }
  38. );
  39. context.MapSubdomainRoute(
  40. "Home.Index", // Route name
  41. new List<string>() { "www", string.Empty }, // Subdomains
  42. new List<string>() { config.Host }, // domains
  43. "", // URL with parameters
  44. new { controller = "Home", action = "Index" }, // Parameter defaults
  45. new[] { typeof(Controllers.HomeController).Namespace }
  46. );
  47. // Register Style Bundles
  48. BundleTable.Bundles.Add(new StyleBundle("~/Content/home").Include(
  49. "~/Areas/Home/Content/Home.css"));
  50. // Register Script Bundles
  51. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/home").Include(
  52. "~/Scripts/PageDown/Markdown.Converter.js",
  53. "~/Scripts/PageDown/Markdown.Sanitizer.js"));
  54. }
  55. }
  56. }