From 57a34e5c025fea04c69b4675c150e779de48dc90 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Mon, 10 Feb 2025 00:50:43 +0000 Subject: [PATCH] use fs/promises instead of fs --- src/routes/api_docs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/api_docs.ts b/src/routes/api_docs.ts index f2fb9e08e..4f8e65b52 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) {