diff --git a/source/api/actions/meta_ping.ts b/source/api/actions/meta_ping.ts new file mode 100644 index 0000000..62f7681 --- /dev/null +++ b/source/api/actions/meta_ping.ts @@ -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 +. + */ + +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", + }); + }, + } + ); + } + +} + diff --git a/source/api/functions.ts b/source/api/functions.ts index 05912a9..8ae3427 100644 --- a/source/api/functions.ts +++ b/source/api/functions.ts @@ -35,6 +35,7 @@ namespace _espe.api ); // meta { + _espe.api.register_meta_ping(rest_subject); _espe.api.register_meta_spec(rest_subject); } // session diff --git a/todo.md b/todo.md index d0df3e1..e0653eb 100644 --- a/todo.md +++ b/todo.md @@ -1,5 +1,4 @@ # ToDo -- ping/echo-Aktion - Übersetzungen diff --git a/tools/makefile b/tools/makefile index 05e594f..671b6e1 100644 --- a/tools/makefile +++ b/tools/makefile @@ -51,6 +51,7 @@ ${dir_temp}/espe-core.js ${dir_temp}/espe-core.d.ts: \ ${dir_source}/services/member.ts \ ${dir_source}/service-admin.ts \ ${dir_source}/api/base.ts \ + ${dir_source}/api/actions/meta_ping.ts \ ${dir_source}/api/actions/meta_spec.ts \ ${dir_source}/api/actions/session_begin.ts \ ${dir_source}/api/actions/session_end.ts \