server-esm: Fix use of __dirname

This commit is contained in:
Elian Doran
2024-07-19 00:18:35 +03:00
parent 27c296fa6c
commit b6c5880484
10 changed files with 57 additions and 14 deletions

View File

@@ -3,7 +3,8 @@ import { Router } from "express";
import fs from "fs";
import path from "path";
const specPath = path.join(__dirname, 'etapi.openapi.yaml');
import { fileURLToPath } from "url";
const specPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'etapi.openapi.yaml');
let spec: string | null = null;
function register(router: Router) {