parent
3e940c2db5
commit
cea5993049
23
src/controllers/StatusController.ts
Normal file
23
src/controllers/StatusController.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
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