// https://swagger.io/docs/specification/about/
import swaggerJsdoc from "swagger-jsdoc"
import fs from 'fs'
const swaggerOptions = {
    definition: {
        openapi: "3.1.0",
        info: {
            title: "Report Server",
            version: "0.8.0",
            description:
                "Advance create and convert document API for microservice era.",
            license: {
                name: "by Frappet",
                url: "https://frappet.com",
            },
        },
        servers: [
            {url: "https://report-server.frappet.synology.me"},
            {url:"https://bma-ehr.frappet.synology.me/"},
            {url: "http://localhost:3000"},
            {url: "http://192.168.2.100:3000"},
        ],
    },
    apis: ["./libs/*.ts"],
};
export function createSpec(){
    const swaggerSpecs = swaggerJsdoc(swaggerOptions);
    fs.promises.writeFile("libs/swagger-specs.json",JSON.stringify(swaggerSpecs,null,2))
} 
createSpec()

