Update MVC sample to include a route

This commit is contained in:
Ryan Nowak 2015-03-30 19:23:58 -07:00
parent 9d9e844a3d
commit 6626035c22
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,4 @@
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Routing;
using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection;
namespace HelloMvc namespace HelloMvc
@ -15,7 +14,10 @@ namespace HelloMvc
{ {
app.UseErrorPage(); app.UseErrorPage();
app.UseMvc(); app.UseMvc(routes =>
{
routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}");
});
app.UseWelcomePage(); app.UseWelcomePage();
} }

View File

@ -12,7 +12,6 @@
"dependencies": { "dependencies": {
"Kestrel": "1.0.0-*", "Kestrel": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*", "Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.AspNet.Hosting": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*" "Microsoft.AspNet.Server.WebListener": "1.0.0-*"