fix: API Reference page not loading (#532)

The API reference page was blank because spec.content expected a parsed
JSON object but received a JSON string. Added JSON.parse() to properly
parse the OpenAPI spec before passing it to @scalar/express-api-reference.

Fixes #532
This commit is contained in:
aj7ay
2026-01-09 12:20:59 +05:30
parent 5dea324626
commit bb8e6229d3

View File

@@ -41,7 +41,7 @@ process.env.UPLOAD_PATH = "./uploads";
app.use(base + "/uploads", express.static("uploads"));
try {
const openapiJSON = fs.readFileSync("./openapi.json", "utf-8");
const openapiJSON = JSON.parse(fs.readFileSync("./openapi.json", "utf-8"));
app.use(
"/api-reference",
apiReference({