fix: use fileURLToPath for dirname resolution (#289)

This commit is contained in:
Eliezer Castro
2025-10-05 04:47:56 -03:00
committed by GitHub
parent b87ce0c3be
commit 43808990eb

View File

@@ -1,9 +1,11 @@
import path from 'path';
import { fileURLToPath } from 'url';
import express from 'express';
import cors from 'cors';
import RateLimit from 'express-rate-limit';
import { Sequelize } from 'sequelize';
const __dirname = path.dirname(new URL(import.meta.url).pathname);
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const app = express();
// enable frontend access