Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

78 lines
2.3 KiB

// ==========================================================================
// 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
{
/// <summary>
/// Makes a ping request.
/// </summary>
[ApiExplorerSettings(GroupName = nameof(Ping))]
public sealed class PingController : ApiController
{
private readonly ExposedValues exposedValues;
public PingController(ICommandBus commandBus, ExposedValues exposedValues)
: base(commandBus)
{
this.exposedValues = exposedValues;
}
/// <summary>
/// Get general info status of the API.
/// </summary>
/// <returns>
/// 200 => Infos returned.
/// </returns>
[HttpGet]
[ProducesResponseType(typeof(ExposedValues), 200)]
[Route("info/")]
public IActionResult Info()
{
return Ok(exposedValues);
}
/// <summary>
/// Get ping status of the API.
/// </summary>
/// <returns>
/// 204 => Service ping successful.
/// </returns>
/// <remarks>
/// Can be used to test, if the Squidex API is alive and responding.
/// </remarks>
[HttpGet]
[Route("ping/")]
public IActionResult GetPing()
{
return NoContent();
}
/// <summary>
/// Get ping status.
/// </summary>
/// <param name="app">The name of the app.</param>
/// <returns>
/// 204 => Service ping successful.
/// </returns>
/// <remarks>
/// Can be used to test, if the Squidex API is alive and responding.
/// </remarks>
[HttpGet]
[Route("ping/{app}/")]
[ApiPermission(Permissions.AppCommon)]
[ApiCosts(0)]
public IActionResult GetAppPing(string app)
{
return NoContent();
}
}
}