示例#1
0
        public void Start()
        {
            _service = WebApp.Start(BaseUri, app =>
            {
                Log.Debug($"Starting OWIN web application on {BaseUri}");

                if (UseWindowsAuthentication)
                {
                    var listener = (HttpListener)app.Properties["System.Net.HttpListener"];
                    listener.AuthenticationSchemes = AuthenticationSchemes.IntegratedWindowsAuthentication;
                }

                SwaggerConfig.RegisterConfig(_config);

                Log.Debug(" .. using Cors");
                app.UseCors(CorsOptions.AllowAll);

                Log.Debug(" .. using autofac middleware");
                app.UseAutofacMiddleware(Container);

                Log.Debug(" .. using autofacwebapi");
                app.UseAutofacWebApi(_config);

                Log.Debug(" .. using webapi");
                app.UseWebApi(_config);

                Log.Debug(" .. mapping signalr");
//                app.MapSignalR("/signalr", new HubConfiguration
//                {
//                    EnableDetailedErrors = true
//                });
            });
        }