testing user controller

This commit is contained in:
Nicolas Constant 2020-03-21 01:16:07 -04:00
parent 75b6f32f87
commit b7c73778b2
No known key found for this signature in database
GPG key ID: 1E9F677FB01A5688
3 changed files with 32 additions and 1 deletions

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
</ItemGroup>

View file

@ -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();
}
}
}

View file

@ -0,0 +1,7 @@

@{
ViewData["Title"] = "User";
}
<h1>User</h1>