2025-01-02 02:27:43 +00:00
|
|
|
import { z } from 'zod';
|
|
|
|
|
import { extendZodWithOpenApi } from 'hono-zod-openapi';
|
|
|
|
|
import { Container } from '@needle-di/core';
|
|
|
|
|
import { ApplicationController } from './application.controller';
|
|
|
|
|
import { ApplicationModule } from './application.module';
|
2024-12-31 22:43:09 +00:00
|
|
|
|
2025-01-02 02:27:43 +00:00
|
|
|
extendZodWithOpenApi(z);
|
2024-12-31 22:43:09 +00:00
|
|
|
|
2025-01-02 02:27:43 +00:00
|
|
|
const applicationController = new Container().get(ApplicationController);
|
|
|
|
|
const applicationModule = new Container().get(ApplicationModule);
|
2024-12-31 22:43:09 +00:00
|
|
|
|
2025-01-02 02:27:43 +00:00
|
|
|
/* ------------------------------ startServer ------------------------------ */
|
|
|
|
|
export function startServer() {
|
|
|
|
|
return applicationModule.start();
|
|
|
|
|
}
|
2024-12-31 22:43:09 +00:00
|
|
|
|
2025-01-02 02:27:43 +00:00
|
|
|
/* ----------------------------------- api ---------------------------------- */
|
|
|
|
|
export const routes = applicationController.registerControllers();
|
2024-12-31 22:43:09 +00:00
|
|
|
|
2025-01-02 02:27:43 +00:00
|
|
|
/* ---------------------------------- Types --------------------------------- */
|
2024-12-31 22:43:09 +00:00
|
|
|
export type ApiRoutes = typeof routes;
|