Add common swagger that combine auth & api

This commit is contained in:
Zoe Roux
2025-03-27 09:42:22 +01:00
parent 4dbb41f008
commit d0d12cc5f6
4 changed files with 23 additions and 19 deletions
+9 -1
View File
@@ -1,4 +1,5 @@
import { swagger } from "@elysiajs/swagger";
import Elysia from "elysia";
import { app } from "./base";
import { processImages } from "./controllers/seed/images";
import { migrate } from "./db";
@@ -9,9 +10,15 @@ await migrate();
// run image processor task in background
processImages();
app
new Elysia()
.use(
swagger({
scalarConfig: {
sources: [
{ slug: "kyoo", url: "/swagger/json" },
{ slug: "keibi", url: "http://localhost:4568/auth/swagger/doc.json" },
],
},
documentation: {
info: {
title: "Kyoo",
@@ -72,6 +79,7 @@ app
},
}),
)
.use(app)
.listen(3567);
console.log(`Api running at ${app.server?.hostname}:${app.server?.port}`);