2 Commits
1.3.1 ... dev

Author SHA1 Message Date
William Oldham
f5cec7ba24 Merge pull request #40 from qtchaos/index-OK
Add a success message to the base path
2024-02-26 12:41:12 +00:00
qtchaos
db00030df0 feat: add a success message to the base path 2024-02-26 14:13:59 +02:00
2 changed files with 16 additions and 0 deletions

View File

@@ -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);
}

14
src/routes/index.ts Normal file
View File

@@ -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})`,
};
}),
);
});