2022-12-25 20:10:23 +00:00
|
|
|
|
import type { FastifyServerOptions } from "fastify";
|
|
|
|
|
import type { FastifyDynamicSwaggerOptions } from "@fastify/swagger";
|
|
|
|
|
import type { FastifySwaggerUiOptions } from "@fastify/swagger-ui";
|
2022-12-16 00:36:33 +00:00
|
|
|
|
|
|
|
|
|
type Default = {
|
2022-12-25 20:10:23 +00:00
|
|
|
|
readonly fastifyOptions: FastifyServerOptions;
|
|
|
|
|
readonly swaggerOptions: FastifyDynamicSwaggerOptions;
|
|
|
|
|
readonly swaggerUIOptions: FastifySwaggerUiOptions;
|
2022-12-16 00:36:33 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const DEFAULT: Default = {
|
2022-12-25 20:10:23 +00:00
|
|
|
|
fastifyOptions: {
|
|
|
|
|
logger: true,
|
|
|
|
|
ajv: {
|
|
|
|
|
customOptions: { removeAdditional: "failing" },
|
|
|
|
|
},
|
|
|
|
|
bodyLimit: 30 * 1024 * 1024,
|
|
|
|
|
},
|
|
|
|
|
swaggerOptions: {
|
|
|
|
|
openapi: {
|
|
|
|
|
info: {
|
|
|
|
|
title: "Hub Admin Backend",
|
|
|
|
|
description: "Тестирование сервиса админ панели хаба",
|
|
|
|
|
version: "0.1.0",
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
securitySchemes: {
|
|
|
|
|
bearer: {
|
|
|
|
|
description: "Authorization header token, sample: Bearer <token>",
|
|
|
|
|
type: "http",
|
|
|
|
|
bearerFormat: "JWT",
|
|
|
|
|
scheme: "bearer",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
hideUntagged: true,
|
|
|
|
|
},
|
|
|
|
|
swaggerUIOptions: {
|
|
|
|
|
routePrefix: "/swagger",
|
|
|
|
|
uiConfig: {
|
|
|
|
|
docExpansion: "full",
|
|
|
|
|
deepLinking: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
2022-12-16 00:36:33 +00:00
|
|
|
|
};
|