// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using Microsoft.AspNetCore.Mvc; using Squidex.Infrastructure.Commands; using Squidex.Shared; using Squidex.Web; namespace Squidex.Areas.Api.Controllers.Ping { /// /// Makes a ping request. /// [ApiExplorerSettings(GroupName = nameof(Ping))] public sealed class PingController : ApiController { private readonly ExposedValues exposedValues; public PingController(ICommandBus commandBus, ExposedValues exposedValues) : base(commandBus) { this.exposedValues = exposedValues; } /// /// Get general info status of the API. /// /// /// 200 => Infos returned. /// [HttpGet] [ProducesResponseType(typeof(ExposedValues), 200)] [Route("info/")] public IActionResult Info() { return Ok(exposedValues); } /// /// Get ping status of the API. /// /// /// 204 => Service ping successful. /// /// /// Can be used to test, if the Squidex API is alive and responding. /// [HttpGet] [Route("ping/")] public IActionResult GetPing() { return NoContent(); } /// /// Get ping status. /// /// The name of the app. /// /// 204 => Service ping successful. /// /// /// Can be used to test, if the Squidex API is alive and responding. /// [HttpGet] [Route("ping/{app}/")] [ApiPermission(Permissions.AppCommon)] [ApiCosts(0)] public IActionResult GetAppPing(string app) { return NoContent(); } } }