Support TS, swagger,Template(xls,docx),PDF convert

This commit is contained in:
Sorawit Bholsithi 2023-10-07 17:29:53 +07:00
parent b221deb1cf
commit 8d7654423a
84 changed files with 3604 additions and 1 deletions

View file

@ -0,0 +1,36 @@
// 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.1.0",
description:
"Advance Create and convert document API for microservice.",
license: {
name: "by Frappet",
url: "https://frappet.com",
},
},
servers: [
{
url: "https://report-server.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()