public void Configuration(IAppBuilder appBuilder) { System.Net.ServicePointManager.DefaultConnectionLimit = 256; HttpConfiguration config = new HttpConfiguration(); FormatterConfig.ConfigureFormatters(config.Formatters); RouteConfig.RegisterRoutes(config.Routes); appBuilder.UseWebApi(config); }
public void Configuration(IAppBuilder appBuilder) { appBuilder.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); System.Net.ServicePointManager.DefaultConnectionLimit = 256; HttpConfiguration config = new HttpConfiguration(); FormatterConfig.ConfigureFormatters(config.Formatters); RouteConfig.RegisterRoutes(config.Routes); SetUpStaticFileHosting(appBuilder); appBuilder.UseWebApi(config); }
public void Configuration(IAppBuilder appBuilder) { System.Net.ServicePointManager.DefaultConnectionLimit = 256; HttpConfiguration config = new HttpConfiguration(); FormatterConfig.ConfigureFormatters(config.Formatters); PhysicalFileSystem physicalFileSystem = new PhysicalFileSystem(@".\wwwroot"); FileServerOptions fileOptions = new FileServerOptions(); fileOptions.EnableDefaultFiles = true; fileOptions.RequestPath = PathString.Empty; fileOptions.FileSystem = physicalFileSystem; fileOptions.DefaultFilesOptions.DefaultFileNames = new[] { "index.html" }; fileOptions.StaticFileOptions.FileSystem = fileOptions.FileSystem = physicalFileSystem; fileOptions.StaticFileOptions.ServeUnknownFileTypes = true; config.MapHttpAttributeRoutes(); appBuilder.UseWebApi(config); appBuilder.UseFileServer(fileOptions); }