chore: seperate into packages
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import type { FastifyPluginAsyncZod } from 'fastify-type-provider-zod';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { DatabaseService } from '#root/services/database/database.js';
|
||||
|
||||
const systemEndpoints: FastifyPluginAsyncZod = async (instance) => {
|
||||
instance.route({
|
||||
method: 'GET',
|
||||
@@ -18,9 +16,8 @@ const systemEndpoints: FastifyPluginAsyncZod = async (instance) => {
|
||||
},
|
||||
},
|
||||
handler: async (_, reply) => {
|
||||
const { services } = instance;
|
||||
const databaseService = services.get(DatabaseService);
|
||||
const db = await databaseService.getInstance();
|
||||
const { runtime } = instance;
|
||||
const db = await runtime.database.getInstance();
|
||||
await db.raw('SELECT 1=1');
|
||||
await reply.send({
|
||||
status: 'ok',
|
||||
|
||||
Reference in New Issue
Block a user