The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

VaultAreaRegistration.cs 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. using Teknik.Configuration;
  5. using Teknik.Utilities;
  6. namespace Teknik.Areas.Vault
  7. {
  8. public class VaultAreaRegistration : AreaRegistration
  9. {
  10. public override string AreaName
  11. {
  12. get
  13. {
  14. return "Vault";
  15. }
  16. }
  17. public override void RegisterArea(AreaRegistrationContext context)
  18. {
  19. Config config = Config.Load();
  20. context.MapSubdomainRoute(
  21. "Vault.Create",
  22. new List<string>() { "vault", "v" }, // Subdomains
  23. new List<string>() { config.Host }, // domains
  24. "",
  25. new { controller = "Vault", action = "Create" },
  26. new[] { typeof(Controllers.VaultController).Namespace }
  27. );
  28. context.MapSubdomainRoute(
  29. "Vault.ViewVault",
  30. new List<string>() { "vault", "v" }, // Subdomains
  31. new List<string>() { config.Host }, // domains
  32. "{id}",
  33. new { controller = "Vault", action = "ViewVault" },
  34. new[] { typeof(Controllers.VaultController).Namespace }
  35. );
  36. // Register style bundles
  37. BundleTable.Bundles.Add(new CdnStyleBundle("~/Content/vault", config.CdnHost).Include(
  38. "~/Areas/Vault/Content/Vault.css"));
  39. // Register Script Bundle
  40. BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/vault", config.CdnHost).Include(
  41. "~/Areas/Vault/Scripts/Vault.js"));
  42. }
  43. }
  44. }