diff --git a/QRCodeService/Startup.cs b/QRCodeService/Startup.cs index 058d576..650615e 100644 --- a/QRCodeService/Startup.cs +++ b/QRCodeService/Startup.cs @@ -79,10 +79,10 @@ namespace QRCodeService services.AddScoped(); services.AddScoped(); //Queries - services.AddScoped( s=>new LinkQueries(Configuration.GetConnectionString("Default"))); + services.AddScoped(s => new LinkQueries(Configuration.GetConnectionString("Default"))); services.AddScoped(s => new AppQueries(Configuration.GetConnectionString("Default"))); //redis cache - services.AddDistributedRedisCache(options=>options.Configuration=Configuration.GetSection("redis:default").Value); + services.AddDistributedRedisCache(options => options.Configuration = Configuration.GetSection("redis:default").Value); //反向代理中间件 services.Configure(options => @@ -95,12 +95,12 @@ namespace QRCodeService // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseSwagger(); - app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "QRCodeService v1")); - } + //if (env.IsDevelopment()) + //{ + app.UseDeveloperExceptionPage(); + app.UseSwagger(); + app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "QRCodeService v1")); + //} app.UseForwardedHeaders(); app.UseRouting();