This commit is contained in:
@@ -2,10 +2,13 @@ import Fastify from "fastify";
|
||||
import cors from "@fastify/cors";
|
||||
import mercurius from "mercurius";
|
||||
import { typeDefs, resolvers } from "./schema.js";
|
||||
import { registerIngestionRoutes } from "./ingest.js";
|
||||
import { ensureGraph } from "./db.js";
|
||||
|
||||
const PORT = Number.parseInt(process.env.PORT || "8000", 10);
|
||||
|
||||
const app = Fastify();
|
||||
await ensureGraph();
|
||||
await app.register(cors, { origin: ["https://optovia.ru"], credentials: true });
|
||||
await app.register(mercurius, {
|
||||
schema: typeDefs,
|
||||
@@ -13,6 +16,7 @@ await app.register(mercurius, {
|
||||
path: "/graphql/public",
|
||||
graphiql: true,
|
||||
});
|
||||
await registerIngestionRoutes(app);
|
||||
|
||||
app.get("/health", async () => ({ status: "ok" }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user