Add session management
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import fastify from "fastify";
|
||||
import cors from "@fastify/cors";
|
||||
import multipart from "@fastify/multipart";
|
||||
|
||||
import routes from "./routes";
|
||||
@@ -9,6 +10,8 @@ import { errorHandler } from "./utils/errors";
|
||||
import { authorize } from "./auth";
|
||||
import { permitSchemas } from "./permit/permit.schema";
|
||||
import { fileSchemas } from "./file/file.schema";
|
||||
import { oauth } from "./oauth";
|
||||
import { authRoutes } from "./auth/auth.route";
|
||||
|
||||
const app = fastify({ logger: true });
|
||||
|
||||
@@ -16,9 +19,16 @@ app.get("/health", (req, res) => {
|
||||
return { status: "OK" };
|
||||
});
|
||||
|
||||
oauth(app);
|
||||
|
||||
app.decorate("authorize", authorize);
|
||||
app.setErrorHandler(errorHandler);
|
||||
app.register(cors, {
|
||||
origin: [process.env.UI_DOMAIN || ""],
|
||||
credentials: true,
|
||||
});
|
||||
app.register(multipart, { limits: { fileSize: 50000000 } });
|
||||
app.register(authRoutes, { prefix: "/auth" });
|
||||
app.register(routes, { prefix: "/api/v1" });
|
||||
|
||||
for (const schema of [
|
||||
|
||||
Reference in New Issue
Block a user