Merge pull request 'feature/34-status_health' (#36) from feature/34-status_health into dev
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #36 closes #34
This commit is contained in:
commit
314606addd
22
src/controllers/StatusController.ts
Normal file
22
src/controllers/StatusController.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { Get, JsonController } from 'routing-controllers';
|
||||||
|
import { OpenAPI } from 'routing-controllers-openapi';
|
||||||
|
import { getConnection } from 'typeorm';
|
||||||
|
|
||||||
|
@JsonController('/status')
|
||||||
|
export class StatusController {
|
||||||
|
|
||||||
|
@Get()
|
||||||
|
@OpenAPI({ description: "Lists all tracks." })
|
||||||
|
get() {
|
||||||
|
let connection;
|
||||||
|
try {
|
||||||
|
connection = getConnection();
|
||||||
|
} catch {
|
||||||
|
throw new Error("sth is wrong, i can feel it....");
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
"controllers": "✔",
|
||||||
|
"database connection": "✔"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user