build stuff

This commit is contained in:
2025-12-12 17:27:08 -06:00
parent 3e8ff8ef4c
commit c3b2acd033
7 changed files with 1257 additions and 23 deletions

View File

@@ -1,10 +1,34 @@
import { apiReference } from "@scalar/express-api-reference";
import type { Express, Response } from "express";
import { openApiSpec } from "../scaler/config.js";
export const setupRoutes = (app: Express) => {
/**
* @openapi
* /:
* get:
* summary: Health check
* responses:
* 200:
* description: Success
*/
app.get("/", (_, res: Response) => {
res.status(200).json({
success: true,
message: "This is just an example of this working",
});
});
app.get("/api/docs.json", (_, res) => {
res.json(openApiSpec);
});
app.use(
"/api/dos",
apiReference({
// Put your OpenAPI url here:
url: "/openapi.json",
theme: "purple",
}),
);
};