From aa286013a146fe2ad11c1601bef529ad956a9fed Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 1 Mar 2021 17:25:12 +0100 Subject: [PATCH] Added status controller --- src/controllers/StatusController.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/controllers/StatusController.ts diff --git a/src/controllers/StatusController.ts b/src/controllers/StatusController.ts new file mode 100644 index 0000000..9578169 --- /dev/null +++ b/src/controllers/StatusController.ts @@ -0,0 +1,17 @@ +import { Get, JsonController } from 'routing-controllers'; +import { OpenAPI } from 'routing-controllers-openapi'; +import { config } from '../config'; + +/** + * The statuscontroller provides simple endpoints concerning basic information about the server. + */ +@JsonController() +export class StatusController { + @Get('/version') + @OpenAPI({ description: "A very basic endpoint that just returns the curent package version." }) + getVersion() { + return { + "version": config.version + } + } +} \ No newline at end of file