feat: migrate app to local Fastify and Postgres stack
Replace Supabase auth and search runtime with a local Fastify API, PostgreSQL/PostGIS schema, and local session handling. Scaffold the worker and deep-research foundations while keeping the existing research, dashboard, and map flows running on the new backend.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import Fastify from 'fastify';
|
||||
import cookie from '@fastify/cookie';
|
||||
import cors from '@fastify/cors';
|
||||
import { getEnv } from './config/env.js';
|
||||
import { authRoutes } from './routes/auth.js';
|
||||
import { healthRoutes } from './routes/health.js';
|
||||
import { searchJobRoutes } from './routes/search-jobs.js';
|
||||
|
||||
export async function buildApp() {
|
||||
const env = getEnv();
|
||||
const app = Fastify({
|
||||
logger: true,
|
||||
});
|
||||
|
||||
await app.register(cors, {
|
||||
origin: env.APP_ORIGIN,
|
||||
credentials: true,
|
||||
});
|
||||
|
||||
await app.register(cookie, {
|
||||
secret: env.COOKIE_SECRET,
|
||||
hook: 'onRequest',
|
||||
});
|
||||
|
||||
await app.register(healthRoutes, { prefix: '/api' });
|
||||
await app.register(authRoutes, { prefix: '/api' });
|
||||
await app.register(searchJobRoutes, { prefix: '/api' });
|
||||
|
||||
return app;
|
||||
}
|
||||
Reference in New Issue
Block a user