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.

35 lines
1.4 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web.Http;
  5. using System.Web.Mvc;
  6. namespace DefenseWeb
  7. {
  8. public static class WebApiConfig
  9. {
  10. public static void Register(HttpConfiguration config)
  11. {
  12. config.Routes.MapHttpRoute(
  13. name: "RestfulDefaultApi",
  14. routeTemplate: "rapi/{controller}/{target}/{data}",
  15. defaults: new { controller="RCmd", target = "NoTarget", data = RouteParameter.Optional }
  16. );
  17. config.Routes.MapHttpRoute(
  18. name: "DefaultApi",
  19. routeTemplate: "api/{controller}/{data}",
  20. defaults: new { data = RouteParameter.Optional }
  21. );
  22. // 取消註解以下程式碼行以啟用透過 IQueryable 或 IQueryable<T> 傳回類型的動作查詢支援。
  23. // 為了避免處理未預期或惡意佇列,請使用 QueryableAttribute 中的驗證設定來驗證傳入的查詢。
  24. // 如需詳細資訊,請造訪 http://go.microsoft.com/fwlink/?LinkId=279712。
  25. //config.EnableQuerySupport();
  26. // 若要停用您應用程式中的追蹤,請將下列程式碼行標記為註解或加以移除
  27. // 如需詳細資訊,請參閱: http://www.asp.net/web-api
  28. //config.EnableSystemDiagnosticsTracing();
  29. }
  30. }
  31. }