Skip to content

Commit

Permalink
Merge pull request #550 from osu-tournament-rating/feature/ping
Browse files Browse the repository at this point in the history
Add `DiagnosticsController` with `ping` endpoint
  • Loading branch information
hburn7 authored Nov 27, 2024
2 parents e2bc08d + 1003b4a commit 1897af1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions API/Controllers/DiagnosticsController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Asp.Versioning;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace API.Controllers;

[ApiController]
[ApiVersion(1)]
[Route("api/v{version:apiVersion}/[controller]")]
public class DiagnosticsController : Controller
{
/// <summary>
/// Allows clients to determine if the server is running
/// </summary>
/// <response code="200>The server is running</response>
[HttpGet("ping")]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
public Task<IActionResult> PingAsync() => Task.FromResult<IActionResult>(Ok());
}

0 comments on commit 1897af1

Please sign in to comment.