public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "HelpPage_Default",
                "Help/{controller}/{action}/{apiId}",
                new { area = "HelpPage", controller = "Help", action = "Index", apiId = UrlParameter.Optional },
                new[] { "CIEDigitalLib.Controllers", "CIEDigitalLib.Controllers.API" });

            DocumentationConfig.Register(GlobalConfiguration.Configuration);
        }
Example #2
0
        /// <summary>
        /// The application start method.
        /// </summary>
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            TraceConfig.RegisterListener(GlobalConfiguration.Configuration);
            FormatConfig.ConfigureFormats(GlobalConfiguration.Configuration);
            DependencyConfig.ResolveDependencies(GlobalConfiguration.Configuration);
            DocumentationConfig.Configure(GlobalConfiguration.Configuration);

            // Ensure that your Web API is only accessed via HTTPS
            // GlobalConfiguration.Configuration.Filters.Add(new MyEvents.Api.Authentication.OnlyHttpsAttribute());
        }
Example #3
0
        /// <summary>
        ///     Configures the application
        /// </summary>
        /// <param name="app">The app builder</param>
        /// <param name="serviceFacade">An instance of the service facade ofr mocking unit tests</param>
        public void Configuration(IAppBuilder app, IServiceFacade serviceFacade)
        {
            var config = new HttpConfiguration();

            ApiRouteConfig.Register(config);
            FormattersConfig.Register(config);
            MapperConfig.Initialize();
            DocumentationConfig.Register(config);

            // authorize all requests
            config.Filters.Add(new AuthorizeAttribute());

            // ioc container
            ContainerConfig.Register(app, config, serviceFacade);

            // cors
            app.UseCors(CorsOptions.AllowAll);
        }