Add file handlers, s3 support

This commit is contained in:
2024-12-27 12:46:28 +05:30
parent 88046d6810
commit 40b2ab54f0
11 changed files with 1533 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import fastify from "fastify";
import multipart from "@fastify/multipart";
import routes from "./routes";
import { userSchemas } from "./user/user.schema";
@@ -7,6 +8,7 @@ import { tokenSchemas } from "./tokens/token.schema";
import { errorHandler } from "./utils/errors";
import { authorize } from "./auth";
import { permitSchemas } from "./permit/permit.schema";
import { fileSchemas } from "./file/file.schema";
const app = fastify({ logger: true });
@@ -16,6 +18,7 @@ app.get("/health", (req, res) => {
app.decorate("authorize", authorize);
app.setErrorHandler(errorHandler);
app.register(multipart, { limits: { fileSize: 50000000 } });
app.register(routes, { prefix: "/api/v1" });
for (const schema of [
@@ -23,6 +26,7 @@ for (const schema of [
...orgSchemas,
...tokenSchemas,
...permitSchemas,
...fileSchemas,
]) {
app.addSchema(schema);
}