wip: trpc

This commit is contained in:
Andras Bacsai
2022-12-21 15:06:33 +01:00
parent e3e39af6fb
commit c8f7ca920e
36 changed files with 1761 additions and 10 deletions

View File

@@ -7,6 +7,8 @@ import * as path from 'node:path';
import serve from '@fastify/static';
import autoLoad from '@fastify/autoload';
// import { prisma } from './prisma';
import Graceful from '@ladjs/graceful';
import { scheduler } from './scheduler';
const isDev = process.env['NODE_ENV'] === 'development';
@@ -60,6 +62,9 @@ export function createServer(opts: ServerOptions) {
try {
await server.listen({ host: '0.0.0.0', port });
console.log('Coolify server is listening on port', port, 'at 0.0.0.0 🚀');
const graceful = new Graceful({ brees: [scheduler] });
graceful.listen();
scheduler.run('worker');
} catch (err) {
server.log.error(err);
process.exit(1);