/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
testassets/TestServer/Controllers/HealthController.cs
26 строк
637 B
Kahbazi
Convert to file-scoped namespace (#1382)
15 ноя 2021, 21:15
Не верифицирован
15 ноя 2021, 21:15
efd2a4c
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.AspNetCore.Mvc; namespace Yarp.ReverseProxy.Sample.Controllers; /// <summary> /// Controller for active health check probes. /// </summary> [ApiController] public class HealthController : ControllerBase { private static volatile int _count; /// <summary> /// Returns 200 if server is healthy. /// </summary> [HttpGet] [Route("/api/health")] public IActionResult CheckHealth() { _count++; // Simulate temporary health degradation. return _count % 10 < 4 ? Ok() : StatusCode(500); } }