32 lines
871 B
C#
32 lines
871 B
C#
using System;
|
|
using Microsoft.AspNet.Builder;
|
|
using Microsoft.AspNet.Http;
|
|
using Microsoft.AspNet.Routing;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace LowercaseUrlsWebSite
|
|
{
|
|
public class Startup
|
|
{
|
|
// Set up application services
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
// Add MVC services to the services container
|
|
services.AddMvc();
|
|
|
|
services.Configure<RouteOptions>(routeOptions => routeOptions.LowercaseUrls = true);
|
|
}
|
|
|
|
public void Configure(IApplicationBuilder app)
|
|
{
|
|
app.UseCultureReplacer();
|
|
|
|
app.UseMvc(routes =>
|
|
{
|
|
routes.MapRoute("Default", "{controller}/{action}/{id?}",
|
|
defaults: new { controller = "Home", action = "Index" });
|
|
});
|
|
}
|
|
}
|
|
}
|