This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
2022-06-29 05:00:35 +02:00

32 lines
735 B
TypeScript

import dotenv from 'dotenv'
import { readPackage } from 'read-pkg'
import { FastifyDynamicSwaggerOptions } from '@fastify/swagger'
dotenv.config()
const packageJSON = await readPackage()
export const swaggerOptions: FastifyDynamicSwaggerOptions = {
routePrefix: '/documentation',
openapi: {
info: {
title: packageJSON.name,
description: packageJSON.description,
version: packageJSON.version
},
tags: [{ name: 'guilds' }, { name: 'messages' }, { name: 'users' }],
components: {
securitySchemes: {
apiKeyAuth: {
type: 'apiKey',
name: 'X-API-KEY',
in: 'header'
}
}
}
},
exposeRoute: true,
staticCSP: true,
hideUntagged: true
}