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.

APIAreaRegistration.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. namespace Teknik.Areas.API
  4. {
  5. public class APIAreaRegistration : AreaRegistration
  6. {
  7. public override string AreaName
  8. {
  9. get
  10. {
  11. return "API";
  12. }
  13. }
  14. public override void RegisterArea(AreaRegistrationContext context)
  15. {
  16. #region API v1
  17. // Base Routing
  18. context.MapSubdomainRoute(
  19. "API.v1.Index", // Route name
  20. new List<string>() { "dev", "api" },
  21. "v1", // URL with parameters
  22. new { controller = "APIv1", action = "Index" }, // Parameter defaults
  23. new[] { typeof(Controllers.APIv1Controller).Namespace }
  24. );
  25. // Uploads
  26. context.MapSubdomainRoute(
  27. "API.v1.Upload", // Route name
  28. new List<string>() { "dev", "api" },
  29. "v1/Upload", // URL with parameters
  30. new { controller = "APIv1", action = "Upload" }, // Parameter defaults
  31. new[] { typeof(Controllers.APIv1Controller).Namespace }
  32. );
  33. #endregion
  34. // Default Routing
  35. context.MapSubdomainRoute(
  36. "API.Index", // Route name
  37. new List<string>() { "dev", "" },
  38. "", // URL with parameters
  39. new { controller = "API", action = "Index" }, // Parameter defaults
  40. new[] { typeof(Controllers.APIController).Namespace }
  41. );
  42. }
  43. }
  44. }