adding nginx page & simulation endpoint

This commit is contained in:
2023-10-26 22:33:28 -03:00
parent bba35341fb
commit 2e71c4e8ed
8 changed files with 77 additions and 3 deletions

View File

@@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Mvc;
using TCC.Services;
namespace TCC.Controllers
{
[ApiController]
[Route("simulation")]
public class SimulationController : ControllerBase
{
public SimulationController()
{
}
[HttpGet("harmonic-progression")]
public async Task<IActionResult> GetHarmonicProgression([FromQuery] int n)
{
float sum = 0;
for (int i = 1; i <= n; i++)
{
sum += 1.0f / i;
}
return Ok(sum);
}
}
}