From 00501bf99a6eeb26b79bbe2c83de84edff7e8f65 Mon Sep 17 00:00:00 2001
From: liaoxujun@qq.com <liaoxujun@qq.com>
Date: 星期四, 07 九月 2023 15:29:37 +0800
Subject: [PATCH] Merge branch 'master' of http://47.108.235.38:8080/r/DocumentService

---
 DocumentFile.Service/Program.cs |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/DocumentFile.Service/Program.cs b/DocumentFile.Service/Program.cs
index f415d33..eb31e67 100644
--- a/DocumentFile.Service/Program.cs
+++ b/DocumentFile.Service/Program.cs
@@ -12,13 +12,14 @@
 builder.Services.AddEndpointsApiExplorer();
 builder.Services.AddSwaggerGen();
 
-builder.WebHost.UseKestrel(options =>
-{
-    //options.Limits.MaxRequestLineSize = int.MaxValue;//HTTP 请求行的最大允许大小。 默认为 8kb
-    //options.Limits.MaxRequestBufferSize = int.MaxValue;//请求缓冲区的最大大小。 默认为 1M
-    //任何请求正文的最大允许大小(以字节为单位),默认 30,000,000 字节,大约为 28.6MB
-    options.Limits.MaxRequestBodySize = 300 * 1024 * 1024; //限制请求长度
-});
+//builder.WebHost.UseKestrel(options =>
+//{
+//配置了这个IIS上不能运行
+//    //options.Limits.MaxRequestLineSize = int.MaxValue;//HTTP 请求行的最大允许大小。 默认为 8kb
+//    //options.Limits.MaxRequestBufferSize = int.MaxValue;//请求缓冲区的最大大小。 默认为 1M
+//    //任何请求正文的最大允许大小(以字节为单位),默认 30,000,000 字节,大约为 28.6MB
+//    options.Limits.MaxRequestBodySize = 300 * 1024 * 1024; //限制请求长度
+//});
 builder.Services.Configure<FormOptions>(options =>
 {
     //默认上传大小限制
@@ -36,13 +37,16 @@
 var app = builder.Build();
 
 // Configure the HTTP request pipeline.
-if (app.Environment.IsDevelopment())
+app.UseSwagger();
+app.UseSwaggerUI(c =>
 {
-    app.UseSwagger();
-    app.UseSwaggerUI();
-}
+    c.SwaggerEndpoint("/swagger/v1/swagger.json", "V1 Docs");
+    c.RoutePrefix = string.Empty;
+    c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);
+    c.DefaultModelsExpandDepth(-1);
+});
 
-app.UseHttpsRedirection();
+//app.UseHttpsRedirection();
 
 app.UseAuthorization();
 

--
Gitblit v1.9.1