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.

ShortenerAreaRegistration.cs 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using Teknik.Configuration;
  4. namespace Teknik.Areas.Shortener
  5. {
  6. public class ShortenerAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "Shortener";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. Config config = Config.Load();
  18. context.MapSubdomainRoute(
  19. "Shortener.Index", // Route name
  20. new List<string>() { "dev", "shorten", "s" }, // Subdomains
  21. new List<string>() { config.Host }, // domains
  22. "", // URL with parameters
  23. new { controller = "Shortener", action = "Index" }, // Parameter defaults
  24. new[] { typeof(Controllers.ShortenerController).Namespace }
  25. );
  26. context.MapSubdomainRoute(
  27. "Shortener.View", // Route name
  28. new List<string>() { "dev", "*" }, // Subdomains
  29. new List<string>() { config.ShortenerConfig.ShortenerHost }, // domains
  30. "", // URL with parameters
  31. new { controller = "Shortener", action = "View" }, // Parameter defaults
  32. new[] { typeof(Controllers.ShortenerController).Namespace }
  33. );
  34. }
  35. }
  36. }