Skip to content

Instantly share code, notes, and snippets.

@CoreyKaylor
Created November 7, 2014 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CoreyKaylor/c4e3223d80698159b192 to your computer and use it in GitHub Desktop.
Save CoreyKaylor/c4e3223d80698159b192 to your computer and use it in GitHub Desktop.
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