Update templates to use endpoint routing (#4500)
This commit is contained in:
parent
c6fa808a91
commit
0c9eda1f4a
|
|
@ -25,9 +25,12 @@ namespace Company.WebApplication1
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.Run(async (context) =>
|
app.UseRouting(routes =>
|
||||||
{
|
{
|
||||||
await context.Response.WriteAsync("Hello World!");
|
routes.MapGet("/", async context =>
|
||||||
|
{
|
||||||
|
await context.Response.WriteAsync("Hello World!");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,6 @@ type Startup() =
|
||||||
if env.IsDevelopment() then
|
if env.IsDevelopment() then
|
||||||
app.UseDeveloperExceptionPage() |> ignore
|
app.UseDeveloperExceptionPage() |> ignore
|
||||||
|
|
||||||
app.Run(fun context -> context.Response.WriteAsync("Hello World!")) |> ignore
|
app.UseRouting(fun routing ->
|
||||||
|
routing.MapGet("/", fun context -> context.Response.WriteAsync("Hello World!")) |> ignore
|
||||||
|
) |> ignore
|
||||||
|
|
@ -155,13 +155,18 @@ namespace Company.WebApplication1
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
|
app.UseRouting(routes =>
|
||||||
|
{
|
||||||
|
routes.MapApplication();
|
||||||
|
});
|
||||||
|
|
||||||
app.UseCookiePolicy();
|
app.UseCookiePolicy();
|
||||||
|
|
||||||
#if (OrganizationalAuth || IndividualAuth)
|
#if (OrganizationalAuth || IndividualAuth)
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
app.UseMvc();
|
app.UseAuthorization();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,18 +154,21 @@ namespace Company.WebApplication1
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
|
app.UseRouting(routes =>
|
||||||
|
{
|
||||||
|
routes.MapApplication();
|
||||||
|
routes.MapControllerRoute(
|
||||||
|
name: "default",
|
||||||
|
template: "{controller=Home}/{action=Index}/{id?}");
|
||||||
|
});
|
||||||
|
|
||||||
app.UseCookiePolicy();
|
app.UseCookiePolicy();
|
||||||
|
|
||||||
#if (OrganizationalAuth || IndividualAuth)
|
#if (OrganizationalAuth || IndividualAuth)
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
app.UseMvc(routes =>
|
app.UseAuthorization();
|
||||||
{
|
|
||||||
routes.MapRoute(
|
|
||||||
name: "default",
|
|
||||||
template: "{controller=Home}/{action=Index}/{id?}");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,13 @@ type Startup private () =
|
||||||
#endif
|
#endif
|
||||||
app.UseStaticFiles() |> ignore
|
app.UseStaticFiles() |> ignore
|
||||||
|
|
||||||
app.UseMvc(fun routes ->
|
app.UseRouting(fun routes ->
|
||||||
routes.MapRoute(
|
routes.MapApplication() |> ignore
|
||||||
|
routes.MapControllerRoute(
|
||||||
name = "default",
|
name = "default",
|
||||||
template = "{controller=Home}/{action=Index}/{id?}") |> ignore
|
template = "{controller=Home}/{action=Index}/{id?}") |> ignore
|
||||||
) |> ignore
|
) |> ignore
|
||||||
|
|
||||||
|
app.UseAuthorization() |> ignore
|
||||||
|
|
||||||
member val Configuration : IConfiguration = null with get, set
|
member val Configuration : IConfiguration = null with get, set
|
||||||
|
|
|
||||||
|
|
@ -61,13 +61,17 @@ namespace Company.WebApplication1
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
#else
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
app.UseRouting(routes =>
|
||||||
|
{
|
||||||
|
routes.MapApplication();
|
||||||
|
});
|
||||||
|
|
||||||
#if (OrganizationalAuth || IndividualAuth)
|
#if (OrganizationalAuth || IndividualAuth)
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
#endif
|
#endif
|
||||||
app.UseMvc();
|
app.UseAuthorization();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@ type Startup private () =
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
app.UseMvc() |> ignore
|
app.UseRouting(fun routes ->
|
||||||
|
routes.MapApplication() |> ignore
|
||||||
|
) |> ignore
|
||||||
|
|
||||||
|
app.UseAuthorization() |> ignore
|
||||||
|
|
||||||
member val Configuration : IConfiguration = null with get, set
|
member val Configuration : IConfiguration = null with get, set
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue