默认显示错误信息
This commit is contained in:
@@ -79,10 +79,10 @@ namespace QRCodeService
|
|||||||
services.AddScoped<IAppRepository, AppRepository>();
|
services.AddScoped<IAppRepository, AppRepository>();
|
||||||
services.AddScoped<ILinkRepository, LinkRepository>();
|
services.AddScoped<ILinkRepository, LinkRepository>();
|
||||||
//Queries
|
//Queries
|
||||||
services.AddScoped<ILinkQueries, LinkQueries>( s=>new LinkQueries(Configuration.GetConnectionString("Default")));
|
services.AddScoped<ILinkQueries, LinkQueries>(s => new LinkQueries(Configuration.GetConnectionString("Default")));
|
||||||
services.AddScoped<IAppQueries, AppQueries>(s => new AppQueries(Configuration.GetConnectionString("Default")));
|
services.AddScoped<IAppQueries, AppQueries>(s => new AppQueries(Configuration.GetConnectionString("Default")));
|
||||||
//redis cache
|
//redis cache
|
||||||
services.AddDistributedRedisCache(options=>options.Configuration=Configuration.GetSection("redis:default").Value);
|
services.AddDistributedRedisCache(options => options.Configuration = Configuration.GetSection("redis:default").Value);
|
||||||
|
|
||||||
//反向代理中间件
|
//反向代理中间件
|
||||||
services.Configure<ForwardedHeadersOptions>(options =>
|
services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
@@ -95,12 +95,12 @@ namespace QRCodeService
|
|||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
if (env.IsDevelopment())
|
//if (env.IsDevelopment())
|
||||||
{
|
//{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "QRCodeService v1"));
|
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "QRCodeService v1"));
|
||||||
}
|
//}
|
||||||
app.UseForwardedHeaders();
|
app.UseForwardedHeaders();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user