use fs/promises instead of fs

This commit is contained in:
perf3ct 2025-02-10 00:50:43 +00:00
parent d859f50c98
commit 57a34e5c02
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -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) {