Initial backend service

This commit is contained in:
Ruslan Bakiev
2026-05-05 12:01:29 +07:00
commit 2357897530
44 changed files with 14773 additions and 0 deletions

22
src/server.ts Normal file
View File

@@ -0,0 +1,22 @@
import Fastify from 'fastify';
import mercurius from 'mercurius';
import { config } from './config.js';
import { prisma } from './prisma.js';
import { resolvers, schema } from './graphql/schema.js';
const app = Fastify({ logger: true });
app.register(mercurius, {
schema,
resolvers,
graphiql: true,
});
app.get('/health', async () => ({ ok: true }));
app.addHook('onClose', async () => {
await prisma.$disconnect();
});
await app.listen({ host: config.host, port: config.port });