import { FastifyInstance } from "fastify"; import { createTokenHandler, getTokenHandler } from "./token.controller"; import { $token } from "./token.schema"; export async function tokenRoutes(fastify: FastifyInstance) { fastify.post( "/", { schema: { body: $token("createTokenInput"), response: { 201: $token("createTokenResponse"), }, }, }, createTokenHandler ); fastify.get( "/:tokenId", { schema: { response: { 200: $token("getTokenResponse") } } }, getTokenHandler ); }