Added token authentication, organization module. Moved server bootstrapping code to server.ts file

This commit is contained in:
2024-12-19 21:49:54 +05:30
parent 970a972b11
commit 4b49c43a0c
16 changed files with 652 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
import { FastifyInstance } from "fastify";
import { $org } from "./organization.schema";
import { createOrgHandler } from "./organization.controller";
import { createOrgHandler, getOrgHandler } from "./organization.controller";
export default function organizationRoutes(fastify: FastifyInstance) {
fastify.post(
@@ -15,4 +15,19 @@ export default function organizationRoutes(fastify: FastifyInstance) {
},
createOrgHandler
);
fastify.get(
"/:orgId",
{
schema: {
params: {
type: "object",
properties: {
orgId: { type: "string" },
},
},
},
},
getOrgHandler
);
}