From b7c73778b2c1377fb4468089032b17808b99a9f8 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Sat, 21 Mar 2020 01:16:07 -0400 Subject: [PATCH] testing user controller --- src/BirdsiteLive/BirdsiteLive.csproj | 3 ++- .../Controllers/UserController.cs | 23 +++++++++++++++++++ src/BirdsiteLive/Views/User/Index.cshtml | 7 ++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/BirdsiteLive/Controllers/UserController.cs create mode 100644 src/BirdsiteLive/Views/User/Index.cshtml diff --git a/src/BirdsiteLive/BirdsiteLive.csproj b/src/BirdsiteLive/BirdsiteLive.csproj index fd1ec84..fd0c830 100644 --- a/src/BirdsiteLive/BirdsiteLive.csproj +++ b/src/BirdsiteLive/BirdsiteLive.csproj @@ -1,4 +1,4 @@ - + netcoreapp3.1 @@ -8,6 +8,7 @@ + diff --git a/src/BirdsiteLive/Controllers/UserController.cs b/src/BirdsiteLive/Controllers/UserController.cs new file mode 100644 index 0000000..7ac8716 --- /dev/null +++ b/src/BirdsiteLive/Controllers/UserController.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace BirdsiteLive.Controllers +{ + public class UserController : Controller + { + [Route("/user")] + public IActionResult Index() + { + var r = Request.Headers["Accept"].First(); + + if(r.Contains("application/activity+json")) + return Json(new { test = "test" }); + + return View(); + } + } +} \ No newline at end of file diff --git a/src/BirdsiteLive/Views/User/Index.cshtml b/src/BirdsiteLive/Views/User/Index.cshtml new file mode 100644 index 0000000..edbda91 --- /dev/null +++ b/src/BirdsiteLive/Views/User/Index.cshtml @@ -0,0 +1,7 @@ + +@{ + ViewData["Title"] = "User"; +} + +

User

+