mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-21 14:46:29 -04:00
Add common swagger that combine auth & api
This commit is contained in:
+9
-1
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user