Add dockerfile, small fixes

This commit is contained in:
2024-12-24 18:38:50 +05:30
parent ca8659fdef
commit 88046d6810
5 changed files with 14 additions and 5 deletions

View File

@@ -1,4 +1,3 @@
import mongoose from "mongoose";
import fastify from "fastify";
import routes from "./routes";
@@ -6,7 +5,7 @@ import { userSchemas } from "./user/user.schema";
import { orgSchemas } from "./organization/organization.schema";
import { tokenSchemas } from "./tokens/token.schema";
import { errorHandler } from "./utils/errors";
import { authHandler, authorize } from "./auth";
import { authorize } from "./auth";
import { permitSchemas } from "./permit/permit.schema";
const app = fastify({ logger: true });
@@ -17,7 +16,6 @@ app.get("/health", (req, res) => {
app.decorate("authorize", authorize);
app.setErrorHandler(errorHandler);
app.addHook("onRequest", authHandler);
app.register(routes, { prefix: "/api/v1" });
for (const schema of [