diff options
Diffstat (limited to 'ApartmentManager/HousingWebAPI/App_Start')
4 files changed, 88 insertions, 0 deletions
diff --git a/ApartmentManager/HousingWebAPI/App_Start/BundleConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/BundleConfig.cs new file mode 100644 index 0000000..12902e6 --- /dev/null +++ b/ApartmentManager/HousingWebAPI/App_Start/BundleConfig.cs @@ -0,0 +1,28 @@ +using System.Web; +using System.Web.Optimization; + +namespace HousingWebAPI +{ + public class BundleConfig + { + // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 + public static void RegisterBundles(BundleCollection bundles) + { + bundles.Add(new ScriptBundle("~/bundles/jquery").Include( + "~/Scripts/jquery-{version}.js")); + + // Use the development version of Modernizr to develop with and learn from. Then, when you're + // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. + bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( + "~/Scripts/modernizr-*")); + + bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( + "~/Scripts/bootstrap.js", + "~/Scripts/respond.js")); + + bundles.Add(new StyleBundle("~/Content/css").Include( + "~/Content/bootstrap.css", + "~/Content/site.css")); + } + } +} diff --git a/ApartmentManager/HousingWebAPI/App_Start/FilterConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/FilterConfig.cs new file mode 100644 index 0000000..cc37135 --- /dev/null +++ b/ApartmentManager/HousingWebAPI/App_Start/FilterConfig.cs @@ -0,0 +1,13 @@ +using System.Web; +using System.Web.Mvc; + +namespace HousingWebAPI +{ + public class FilterConfig + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + } +} diff --git a/ApartmentManager/HousingWebAPI/App_Start/RouteConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/RouteConfig.cs new file mode 100644 index 0000000..6440cfb --- /dev/null +++ b/ApartmentManager/HousingWebAPI/App_Start/RouteConfig.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; + +namespace HousingWebAPI +{ + public class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + name: "Default", + url: "{controller}/{action}/{id}", + defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } + ); + } + } +} diff --git a/ApartmentManager/HousingWebAPI/App_Start/WebApiConfig.cs b/ApartmentManager/HousingWebAPI/App_Start/WebApiConfig.cs new file mode 100644 index 0000000..a49bdaf --- /dev/null +++ b/ApartmentManager/HousingWebAPI/App_Start/WebApiConfig.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Http; + +namespace HousingWebAPI +{ + public static class WebApiConfig + { + public static void Register(HttpConfiguration config) + { + // Web API configuration and services + + // Web API routes + config.MapHttpAttributeRoutes(); + + config.Routes.MapHttpRoute( + name: "DefaultApi", + routeTemplate: "api/{controller}/{id}", + defaults: new { id = RouteParameter.Optional } + ); + } + } +} |