elysiajs / elysia-swagger

A plugin for Elysia to auto-generate Swagger page
MIT License
90 stars 46 forks source link

If path is changed from default "/swagger" then it's showing in the swagger UI #32

Open HKGx opened 1 year ago

HKGx commented 1 year ago

Maybe we could include path by default in the exclude array? https://github.com/elysiajs/elysia-swagger/blob/7a42bf0cde29b45c099c39ed8da6f08c1fe41237/src/index.ts#L111

Example code:

import { Elysia } from "elysia";
import { swagger } from '@elysiajs/swagger'

new Elysia()
  .use(swagger({path: "/docs"}))
  .listen(3000, ({ hostname, port }) => {
    console.log(`Running at http://${hostname}:${port}`)
  })

image