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.

RSSAreaRegistration.cs 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using Teknik.Configuration;
  4. namespace Teknik.Areas.RSS
  5. {
  6. public class RSSAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "RSS";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. Config config = Config.Load();
  18. context.MapSubdomainRoute(
  19. "RSS.Index", // Route name
  20. new List<string>() { "rss" },
  21. new List<string>() { config.Host }, // domains
  22. "", // URL with parameters
  23. new { controller = "RSS", action = "Index" }, // Parameter defaults
  24. new[] { typeof(Controllers.RSSController).Namespace }
  25. );
  26. context.MapSubdomainRoute(
  27. "RSS.Blog", // Route name
  28. new List<string>() { "rss" },
  29. new List<string>() { config.Host }, // domains
  30. "Blog/{username}", // URL with parameters
  31. new { controller = "RSS", action = "Blog", username = UrlParameter.Optional }, // Parameter defaults
  32. new[] { typeof(Controllers.RSSController).Namespace }
  33. );
  34. context.MapSubdomainRoute(
  35. "RSS.Podcast", // Route name
  36. new List<string>() { "rss" },
  37. new List<string>() { config.Host }, // domains
  38. "Podcast", // URL with parameters
  39. new { controller = "RSS", action = "Podcast" }, // Parameter defaults
  40. new[] { typeof(Controllers.RSSController).Namespace }
  41. );
  42. }
  43. }
  44. }