Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ping API method for general health check #227

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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