From 8ab8dd565436cb101976cd5d1bc26feeab9003f2 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 22 Jul 2021 19:45:32 -0400 Subject: [PATCH] initial plumbing and conversion to mvc --- BinaryDad.Coding/Controllers/HomeController.cs | 16 ++++++++++++++++ BinaryDad.Coding/Startup.cs | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 BinaryDad.Coding/Controllers/HomeController.cs diff --git a/BinaryDad.Coding/Controllers/HomeController.cs b/BinaryDad.Coding/Controllers/HomeController.cs new file mode 100644 index 0000000..94472e8 --- /dev/null +++ b/BinaryDad.Coding/Controllers/HomeController.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BinaryDad.Coding.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + return Content("ok"); + } + } +} diff --git a/BinaryDad.Coding/Startup.cs b/BinaryDad.Coding/Startup.cs index 6444356..69c19ee 100644 --- a/BinaryDad.Coding/Startup.cs +++ b/BinaryDad.Coding/Startup.cs @@ -19,7 +19,7 @@ namespace BinaryDad.Coding // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddRazorPages(); + services.AddMvc(); services.AddSignalR(); } @@ -43,7 +43,7 @@ namespace BinaryDad.Coding app.UseEndpoints(endpoints => { - endpoints.MapRazorPages(); + endpoints.MapControllerRoute("default", "{action=Index}/{id?}", new { controller = "Home" }); endpoints.MapHub("/codeHub"); }); }