staging #43
@@ -211,31 +211,30 @@ using (var scope = app.Services.CreateScope())
|
|||||||
if (!app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseExceptionHandler("/Home/Error");
|
app.UseExceptionHandler("/Home/Error");
|
||||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
||||||
app.UseHsts();
|
app.UseHsts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
|
// 🔹 Swagger aktivieren
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI(options =>
|
||||||
|
{
|
||||||
|
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Watcher-Server API v1");
|
||||||
|
options.RoutePrefix = "api/v1/swagger";
|
||||||
|
});
|
||||||
|
|
||||||
|
// 🔹 Authentifizierung & Autorisierung
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
app.UseStaticFiles();
|
// 🔹 MVC-Routing
|
||||||
|
|
||||||
app.MapControllerRoute(
|
app.MapControllerRoute(
|
||||||
name: "default",
|
name: "default",
|
||||||
pattern: "{controller=Home}/{action=Index}/{id?}"
|
pattern: "{controller=Home}/{action=Index}/{id?}"
|
||||||
);
|
);
|
||||||
|
|
||||||
app.MapSwagger();
|
app.Run();
|
||||||
|
|
||||||
app.UseSwaggerUI(options =>
|
|
||||||
{
|
|
||||||
options.SwaggerEndpoint("v1/swagger.json", "Watcher-Server API v1");
|
|
||||||
});
|
|
||||||
|
|
||||||
app.Run();
|
|
||||||
|
|||||||
Reference in New Issue
Block a user