fix(api-server): Various fixes and improvements (#2496)

This commit is contained in:
JustMrPhoenix
2024-10-14 11:48:11 +04:00
committed by GitHub
parent 9d7e2a06bc
commit b6cefef8fb
3 changed files with 17 additions and 38 deletions

View File

@ -73,12 +73,26 @@ export const backend = createBackend<BackendType, APIServerConfig>({
registerAuth(this.app, ctx);
// swagger
this.app.openAPIRegistry.registerComponent(
'securitySchemes',
'bearerAuth',
{
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
},
);
this.app.doc('/doc', {
openapi: '3.1.0',
info: {
version: '1.0.0',
title: 'Youtube Music API Server',
},
security: [
{
bearerAuth: [],
},
],
});
this.app.get('/swagger', swaggerUI({ url: '/doc' }));