27 lines
534 B
TypeScript
27 lines
534 B
TypeScript
import { Controller, Get } from "elysia-decorators";
|
|
import { getAppVersion } from "../common/app-utils";
|
|
import { AppService } from "../service/app.service";
|
|
|
|
@Controller()
|
|
export default class AppController {
|
|
@Get("/")
|
|
public async index() {
|
|
return {
|
|
app: "backend",
|
|
version: await getAppVersion(),
|
|
};
|
|
}
|
|
|
|
@Get("/health")
|
|
public async getHealth() {
|
|
return {
|
|
status: "OK",
|
|
};
|
|
}
|
|
|
|
@Get("/statistics")
|
|
public async getStatistics() {
|
|
return await AppService.getAppStatistics();
|
|
}
|
|
}
|