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 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System.Web.Mvc;
  2. namespace Teknik.Areas.API
  3. {
  4. public class APIAreaRegistration : AreaRegistration
  5. {
  6. public override string AreaName
  7. {
  8. get
  9. {
  10. return "API";
  11. }
  12. }
  13. public override void RegisterArea(AreaRegistrationContext context)
  14. {
  15. #region API v1
  16. // Base Routing
  17. context.MapSubdomainRoute(
  18. "API.Index.v1", // Route name
  19. "dev",
  20. "API/v1", // URL with parameters
  21. new { controller = "API", action = "Index_v1" }, // Parameter defaults
  22. new[] { typeof(Controllers.APIController).Namespace }
  23. );
  24. context.MapSubdomainRoute(
  25. "API.Index.v1", // Route name
  26. "api",
  27. "v1", // URL with parameters
  28. new { controller = "API", action = "Index_v1" }, // Parameter defaults
  29. new[] { typeof(Controllers.APIController).Namespace }
  30. );
  31. // Uploads
  32. context.MapSubdomainRoute(
  33. "API.Upload.v1", // Route name
  34. "dev",
  35. "API/v1/Upload", // URL with parameters
  36. new { controller = "API", action = "Upload_v1" }, // Parameter defaults
  37. new[] { typeof(Controllers.APIController).Namespace }
  38. );
  39. context.MapSubdomainRoute(
  40. "API.Upload.v1", // Route name
  41. "api",
  42. "v1/Upload", // URL with parameters
  43. new { controller = "API", action = "Upload_v1" }, // Parameter defaults
  44. new[] { typeof(Controllers.APIController).Namespace }
  45. );
  46. #endregion
  47. // Default Routing
  48. context.MapSubdomainRoute(
  49. "API.Index", // Route name
  50. "dev",
  51. "API", // URL with parameters
  52. new { controller = "API", action = "Index" }, // Parameter defaults
  53. new[] { typeof(Controllers.APIController).Namespace }
  54. );
  55. context.MapSubdomainRoute(
  56. "API.Index", // Route name
  57. "api",
  58. "", // URL with parameters
  59. new { controller = "API", action = "Index" }, // Parameter defaults
  60. new[] { typeof(Controllers.APIController).Namespace }
  61. );
  62. }
  63. }
  64. }