add some features
This commit is contained in:
@@ -5,9 +5,36 @@ import { asyncHandler } from '../utils/asyncHandler.js';
|
||||
|
||||
const router = Router();
|
||||
|
||||
/**
|
||||
* @openapi
|
||||
* /api/v1/health:
|
||||
* get:
|
||||
* summary: Health check
|
||||
* description: Returns API and database connection status. Checks MariaDB connectivity.
|
||||
* tags:
|
||||
* - Health
|
||||
* responses:
|
||||
* 200:
|
||||
* description: API is healthy
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* status:
|
||||
* type: string
|
||||
* example: ok
|
||||
* service:
|
||||
* type: string
|
||||
* example: check-list-poc-api
|
||||
* database:
|
||||
* type: string
|
||||
* example: connected
|
||||
*/
|
||||
router.get(
|
||||
'/',
|
||||
asyncHandler(async (_req, res) => {
|
||||
console.log(`PUBLIC: GET /api/v1/health`);
|
||||
/*
|
||||
* The health endpoint checks the database on purpose instead of only proving
|
||||
* that Express can answer HTTP. In this project, the server is not useful if
|
||||
|
||||
Reference in New Issue
Block a user