diff --git a/LongevityWorldCup.Website/Controllers/HomeController.cs b/LongevityWorldCup.Website/Controllers/HomeController.cs new file mode 100644 index 0000000..2701f8e --- /dev/null +++ b/LongevityWorldCup.Website/Controllers/HomeController.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LongevityWorldCup.Website.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class HomeController : Controller + { + [HttpGet("join")] + public IActionResult JoinGame() + { + // Return the static index.html file from wwwroot + // This is just a test + return PhysicalFile(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "index.html"), "text/html"); + } + } +} diff --git a/LongevityWorldCup.Website/wwwroot/index.html b/LongevityWorldCup.Website/wwwroot/index.html index 3c34363..86a7250 100644 --- a/LongevityWorldCup.Website/wwwroot/index.html +++ b/LongevityWorldCup.Website/wwwroot/index.html @@ -433,6 +433,11 @@
function getRandomAge() { return Math.floor(Math.random() * (80 - 40 + 1)) + 40; } + +document.querySelector('.join-game').addEventListener('click', function () { + window.location.href = `${window.location.origin}/api/home/join`; +}); +