Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.UseStaticFiles();
app.UseServices(services =>
{
services.AddMvc();
services.SetupOptions<MvcOptions>(x =>
{
x.OutputFormatters.Add(new ViewOutputFormatter());
});
});
// Add MVC to the request pipeline
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Home", action = "Index" });
routes.MapRoute(
name: "api",
template: "{controller}/{id?}");
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment