feat(swagger): added in the start of swagger where all the common and useable endpoints will be

This commit is contained in:
2025-11-25 17:02:20 -06:00
parent bdb4bfc53d
commit 2607fd3026
8 changed files with 238 additions and 20 deletions

View File

@@ -20,9 +20,7 @@ import { baseSettings } from "./src/internal/system/controller/settings/baseSett
import {
addListeners,
manualFixes,
settingsMigrate,
} from "./src/internal/system/utlis/addListeners.js";
import { swaggerOptions } from "./src/pkg/apiDocs/swaggerOptions.js";
import { auth } from "./src/pkg/auth/auth.js";
import { db } from "./src/pkg/db/db.js";
import { settings } from "./src/pkg/db/schema/settings.js";
@@ -35,6 +33,9 @@ import { sendNotify } from "./src/pkg/utils/notify.js";
import { returnFunc } from "./src/pkg/utils/return.js";
import { tryCatch } from "./src/pkg/utils/tryCatch.js";
import { setupIoServer } from "./src/ws/server.js";
import { swaggerConfig, swaggerUiOptions } from "./src/internal/swagger/config.js";
import { setupSwagger } from "./src/internal/swagger/swagger.js";
const main = async () => {
const env = validateEnv(process.env);
@@ -177,13 +178,14 @@ const main = async () => {
);
// docs and routes
const openapiSpec: any = swaggerJsdoc(swaggerOptions);
app.use(
basePath + "/api/docs",
swaggerUi.serve,
swaggerUi.setup(openapiSpec),
);
// const openapiSpec: any = swaggerJsdoc(swaggerConfig);
// app.use(
// basePath + "/api/docs",
// swaggerUi.serve,
// swaggerUi.setup(openapiSpec, swaggerUiOptions),
// );
setupSwagger(app, basePath)
app.use(basePath + "/d", express.static(join(__dirname, "../lstDocs/build")));
app.use(
basePath + "/app",