[add] api:action:meta/ping
This commit is contained in:
parent
03bc5c5f5b
commit
5c5c2dbec7
4 changed files with 56 additions and 1 deletions
54
source/api/actions/meta_ping.ts
Normal file
54
source/api/actions/meta_ping.ts
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
Espe | Ein schlichtes Werkzeug zur Mitglieder-Verwaltung | Backend
|
||||||
|
Copyright (C) 2024 Christian Fraß
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
|
||||||
|
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
|
||||||
|
version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along with this program. If not, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace _espe.api
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
export function register_meta_ping(
|
||||||
|
rest_subject : lib_plankton.rest.type_rest
|
||||||
|
) : void
|
||||||
|
{
|
||||||
|
lib_plankton.rest.register<
|
||||||
|
null,
|
||||||
|
string
|
||||||
|
>
|
||||||
|
(
|
||||||
|
rest_subject,
|
||||||
|
lib_plankton.http.enum_method.get,
|
||||||
|
_espe.conf.get().server.path_base + "/meta/ping",
|
||||||
|
{
|
||||||
|
"description": "sendet ein 'pong' zurück; gedacht um die Erreichbarkeit des Backends zu prüfen",
|
||||||
|
"input_schema": () => ({
|
||||||
|
"nullable": true,
|
||||||
|
}),
|
||||||
|
"output_schema": () => ({
|
||||||
|
"nullable": false,
|
||||||
|
"type": "string",
|
||||||
|
}),
|
||||||
|
"restriction": restriction_none,
|
||||||
|
"execution": () => {
|
||||||
|
return Promise.resolve({
|
||||||
|
"status_code": 200,
|
||||||
|
"data": "pong",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace _espe.api
|
||||||
);
|
);
|
||||||
// meta
|
// meta
|
||||||
{
|
{
|
||||||
|
_espe.api.register_meta_ping(rest_subject);
|
||||||
_espe.api.register_meta_spec(rest_subject);
|
_espe.api.register_meta_spec(rest_subject);
|
||||||
}
|
}
|
||||||
// session
|
// session
|
||||||
|
|
1
todo.md
1
todo.md
|
@ -1,5 +1,4 @@
|
||||||
# ToDo
|
# ToDo
|
||||||
|
|
||||||
- ping/echo-Aktion
|
|
||||||
- Übersetzungen
|
- Übersetzungen
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ ${dir_temp}/espe-core.js ${dir_temp}/espe-core.d.ts: \
|
||||||
${dir_source}/services/member.ts \
|
${dir_source}/services/member.ts \
|
||||||
${dir_source}/service-admin.ts \
|
${dir_source}/service-admin.ts \
|
||||||
${dir_source}/api/base.ts \
|
${dir_source}/api/base.ts \
|
||||||
|
${dir_source}/api/actions/meta_ping.ts \
|
||||||
${dir_source}/api/actions/meta_spec.ts \
|
${dir_source}/api/actions/meta_spec.ts \
|
||||||
${dir_source}/api/actions/session_begin.ts \
|
${dir_source}/api/actions/session_begin.ts \
|
||||||
${dir_source}/api/actions/session_end.ts \
|
${dir_source}/api/actions/session_end.ts \
|
||||||
|
|
Loading…
Add table
Reference in a new issue