Skip to content

Commit

Permalink
Add ping API method for general health check
Browse files Browse the repository at this point in the history
  • Loading branch information
serguun42 committed Nov 15, 2023
1 parent 6e2daba commit 7773549
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
4 changes: 4 additions & 0 deletions backend/pages/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ module.exports = (iModuleDataObject) => {
.catch(Logging);
break;

case "ping":
GlobalSendCustom(200, "pong");
break;

case "logs":
switch (path[3]) {
case "post":
Expand Down
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,3 @@ services:
restart: always
volumes:
- ${FRONTEND_PUBLISH_PATH}:/usr/src/app/mount

networks:
default:
name: mss-network
35 changes: 8 additions & 27 deletions frontend/public/docs/api/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ tags:
description: Fetch or sync time (weeks, days, etc.)
- name: stats
description: Get overall statistics
- name: logs
description: Getting logs from some sources (e.g. app)

paths:
/groups/all:
Expand Down Expand Up @@ -149,37 +147,20 @@ paths:
schema:
$ref: '#/components/schemas/SomeError'

/logs/post:
post:
description: "Post logs from app, front, etc."
operationId: postLogs
/ping:
get:
description: Check service availability
operationId: ping
tags:
- logs
parameters:
- in: query
name: source
schema:
type: string
required: true
description: >
Corresponds for source of logs
example: "app"
requestBody:
description: Actual logs body
required: true
content:
text/plain:
schema:
type: string
example: 'Error NullEx in "app/src/module.kt:42:1337"'
- stats
responses:
'202':
description: Accepted
'200':
description: Pong
content:
text/plain:
schema:
type: string
example: "202 Accepted"
example: pong
default:
description: Some (un)expected error
content:
Expand Down

0 comments on commit 7773549

Please sign in to comment.