예제 #1
0
        public void Configuration(IAppBuilder app)
        {
            // make sure we're logging
            log4net.Config.XmlConfigurator.Configure();

            // configure http
            HttpConfiguration httpConfig = new HttpConfiguration();

            // add the filters (e.g. requiring https)
            FilterConfig.RegisterHttpFilters(httpConfig.Filters);

            // add the handlers (e.g. logging and exception handling)
            LoggingConfig.RegisterHandlers(httpConfig.Services);

            WebSecurity.InitializeDatabaseConnection("ProviderPortalConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true);

            UnityConfig.RegisterComponents(httpConfig);

            ConfigureOAuth(app, (ISettingsProvider)httpConfig.DependencyResolver.GetService(typeof(ISettingsProvider)));

            ConfigureWebApi(httpConfig);

            app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);

            app.UseWebApi(httpConfig);
        }