| | |
| | | Description = $"Panda.Sewerage : {version} ", |
| | | }); |
| | | }); |
| | | |
| | | |
| | | string basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); |
| | | string xmlPath = Path.Combine(basePath, "VueWebCoreApi.xml"); |
| | | c.IncludeXmlComments(xmlPath, true); |
| | |
| | | services.AddTransient<HttpResultfulJob>(); |
| | | services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>(); |
| | | services.AddSingleton<IJobFactory, IOCJobFactory>(); |
| | | |
| | | |
| | | //跨域设置 |
| | | services.AddCors(options => |
| | |
| | | { |
| | | c.SwaggerEndpoint($"/swagger/{version}/swagger.json", $"{version}"); |
| | | }); |
| | | |
| | | |
| | | }); |
| | | #endregion |
| | | app.UseHttpsRedirection(); |
| | |
| | | //添加静态文件中间件 |
| | | app.UseDefaultFiles(); |
| | | //添加授权文件 |
| | | app.UseStaticFiles(new StaticFileOptions() |
| | | { |
| | | ContentTypeProvider = new FileExtensionContentTypeProvider() |
| | | { |
| | | Mappings = { [".xls"] = "application/vnd.ms-excel" } |
| | | } |
| | | app.UseStaticFiles(new StaticFileOptions() { |
| | | ContentTypeProvider = new FileExtensionContentTypeProvider() { |
| | | Mappings = { |
| | | [".xls"] = "application/vnd.ms-excel", |
| | | [".apk"] = "application/vnd.android.package-archive" |
| | | } |
| | | } |
| | | }); |
| | | app.UseStaticFiles(); |
| | | //跨域 |
| | |
| | | // Mappings = { [".exe"] = "application/octect-stream" } |
| | | // } |
| | | //}); |
| | | |
| | | |
| | | app.UseEndpoints(endpoints => |
| | | { |
| | | endpoints.MapControllers(); |
| | | endpoints.MapHub<ChatHub>("/ChatHub", options => |
| | | { |
| | | options.Transports = |
| | | HttpTransportType.WebSockets | |
| | | HttpTransportType.LongPolling; |
| | | options.Transports = |
| | | HttpTransportType.WebSockets | |
| | | HttpTransportType.LongPolling; |
| | | }); |
| | | }); |
| | | loggerFactory.AddLog4Net("Config/log4net.config"); |