Add file handlers, s3 support
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user