diff --git a/OdeToFoodRider/OdeToFoodRider/Controllers/HomeController.cs b/OdeToFoodRider/OdeToFoodRider/Controllers/HomeController.cs new file mode 100644 index 0000000..c93c2c4 --- /dev/null +++ b/OdeToFoodRider/OdeToFoodRider/Controllers/HomeController.cs @@ -0,0 +1,10 @@ +namespace OdeToFoodRider.Controllers +{ + public class HomeController + { + public string Index() + { + return "Hello from Rider's Home controller!"; + } + } +} \ No newline at end of file diff --git a/OdeToFoodRider/OdeToFoodRider/Startup.cs b/OdeToFoodRider/OdeToFoodRider/Startup.cs index f358e78..9342451 100644 --- a/OdeToFoodRider/OdeToFoodRider/Startup.cs +++ b/OdeToFoodRider/OdeToFoodRider/Startup.cs @@ -18,6 +18,7 @@ public class Startup public void ConfigureServices(IServiceCollection services) { services.AddSingleton(); + services.AddMvc(); } @@ -29,8 +30,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IGreeter app.UseDeveloperExceptionPage(); } - app.UseFileServer(); - + app.UseStaticFiles(); + app.UseMvcWithDefaultRoute(); + app.Run(async (context) => { var greeting = greeter.GetMessageOfTheDay(); diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Controllers/HomeController.cs b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Controllers/HomeController.cs new file mode 100644 index 0000000..41bd26c --- /dev/null +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Controllers/HomeController.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace OdeToFoodVisualStudio.Controllers +{ + public class HomeController + { + public string Index() + { + return "Hello from Visual Studio's Home controller"; + + } + } +} diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Startup.cs b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Startup.cs index 8e6c5ea..e463482 100644 --- a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Startup.cs +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Startup.cs @@ -17,6 +17,7 @@ public void ConfigureServices(IServiceCollection services) // RDVS: Rider's completion works better with this generic method as it additionally adds the parentheses; additionally, VS overlaps the completion list inside the generic brackets // with with parameter info services.AddSingleton(); + services.AddMvc(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -27,7 +28,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IGreeter app.UseDeveloperExceptionPage(); } - app.UseFileServer(); + app.UseStaticFiles(); + app.UseMvcWithDefaultRoute(); app.Run(async (context) => {