diff --git a/src/modules/fastify/routes.ts b/src/modules/fastify/routes.ts index c51534f..99381d7 100644 --- a/src/modules/fastify/routes.ts +++ b/src/modules/fastify/routes.ts @@ -1,3 +1,4 @@ +import { indexRouter } from '@/routes'; import { loginAuthRouter } from '@/routes/auth/login'; import { manageAuthRouter } from '@/routes/auth/manage'; import { metaRouter } from '@/routes/meta'; @@ -25,4 +26,5 @@ export async function setupRoutes(app: FastifyInstance) { await app.register(userSettingsRouter.register); await app.register(userGetRouter.register); await app.register(metricsRouter.register); + await app.register(indexRouter.register); } diff --git a/src/routes/index.ts b/src/routes/index.ts new file mode 100644 index 0000000..a9eb13d --- /dev/null +++ b/src/routes/index.ts @@ -0,0 +1,14 @@ +import { version } from '@/config'; +import { handle } from '@/services/handler'; +import { makeRouter } from '@/services/router'; + +export const indexRouter = makeRouter((app) => { + app.get( + '/', + handle(async () => { + return { + message: `Backend is working as expected (${version})`, + }; + }), + ); +});