mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2026-06-05 14:54:27 +00:00
swagger ui options
This commit is contained in:
+4
-1
@@ -33,7 +33,10 @@ const app = new Elysia({
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
swaggerOptions: {
|
||||
persistAuthorization: true
|
||||
},
|
||||
})
|
||||
)
|
||||
.use(plugin)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Elysia } from 'elysia'
|
||||
import { swagger } from '../src/index'
|
||||
import { plugin } from './plugin'
|
||||
|
||||
const app = new Elysia({
|
||||
// aot: false
|
||||
})
|
||||
.use(
|
||||
swagger({
|
||||
documentation: {
|
||||
info: {
|
||||
title: 'Elysia',
|
||||
version: '0.6.10'
|
||||
},
|
||||
tags: [
|
||||
{
|
||||
name: 'Test',
|
||||
description: 'Hello'
|
||||
}
|
||||
],
|
||||
security: [
|
||||
{JwtAuth: []}
|
||||
],
|
||||
components: {
|
||||
schemas: {
|
||||
User: {
|
||||
description: 'string'
|
||||
}
|
||||
},
|
||||
securitySchemes: {
|
||||
JwtAuth: {
|
||||
type: 'http',
|
||||
scheme: 'bearer',
|
||||
bearerFormat: 'JWT',
|
||||
description: 'Enter JWT Bearer token **_only_**'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
swaggerOptions: {
|
||||
persistAuthorization: true
|
||||
},
|
||||
})
|
||||
)
|
||||
.use(plugin)
|
||||
.listen(8080)
|
||||
Reference in New Issue
Block a user