Introduces a very basic version getting endpoint
continuous-integration/drone/pr Build is passing Details

ref #91
This commit is contained in:
Nicolai Ort 2021-01-12 17:41:42 +01:00
parent 295a1524d8
commit a2f4fd5d9b
1 changed files with 11 additions and 2 deletions

View File

@ -1,11 +1,12 @@
import { Get, JsonController } from 'routing-controllers';
import { OpenAPI } from 'routing-controllers-openapi';
import { getConnection } from 'typeorm';
import { config } from '../config';
@JsonController('/status')
@JsonController()
export class StatusController {
@Get()
@Get('/status')
@OpenAPI({ description: "A very basic status/health endpoint that just checks if the database connection is available. <br> The available information depth will be expanded later." })
get() {
let connection;
@ -19,4 +20,12 @@ export class StatusController {
"database connection": "✔"
};
}
@Get('/version')
@OpenAPI({ description: "A very basic endpoint that just returns the curent package version." })
getVersion() {
return {
"version": config.version
}
}
}