1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-08-04 13:21:58 +00:00

feat: Add openapi explorer (#529)

This commit is contained in:
2025-05-04 01:21:54 +02:00
committed by GitHub
parent 98bc4db193
commit 224d9cd1c6
12 changed files with 777 additions and 58 deletions

View File

@@ -0,0 +1,18 @@
import express from 'express'
import fs from 'node:fs'
import swaggerUi from 'swagger-ui-express'
import YAML from 'yaml'
const file = fs.readFileSync('./public/v2/openapi.yaml', 'utf8')
const swaggerDocument = YAML.parse(file)
const server = express.Router()
server.use('/', swaggerUi.serve, swaggerUi.setup(swaggerDocument, {
customCss: '.topbar { display: none }',
customfavIcon: '/favicon.ico',
customSiteTitle: 'Openapi documentation - TCGdex API'
}))
export default server