Skip to content

Build your personal knowledge base with Trilium Notes

use fs/promises instead of fs

perf3ct57a34e5c025f
diff --git a/src/routes/api_docs.ts b/src/routes/api_docs.ts
index f2fb9e08e2..4f8e65b52d 100644
--- a/src/routes/api_docs.ts
+++ b/src/routes/api_docs.ts
@@ -1,13 +1,13 @@
import type { Router } from "express";
import swaggerUi from "swagger-ui-express";
-import { readFileSync } from "fs";
+import { readFile } from "fs/promises";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
import yaml from "js-yaml";
const __dirname = dirname(fileURLToPath(import.meta.url));
const swaggerDocument = yaml.load(
- readFileSync(join(__dirname, "../etapi/etapi.openapi.yaml"), "utf8")
+ await readFile(join(__dirname, "../etapi/etapi.openapi.yaml"), "utf8")
) as object;
function register(router: Router) {