feat: SW-229 Updated to use fileURLToPath

This commit is contained in:
Hrishikesh Vaipurkar
2024-07-19 13:34:18 +02:00
parent 5469b4f18d
commit 2f9296c430

View File

@@ -1,14 +1,11 @@
import createJiti from "jiti"
import { fileURLToPath } from "url"
import { login, logout } from "./constants/routes/handleAuth.js"
import { hotelReservation } from "./constants/routes/hotelReservation.js"
import { myPages } from "./constants/routes/myPages.js"
let path = new URL(import.meta.url).pathname
// Update the path if running in windows system
if (process.platform === "win32") {
path = path.replace(/^\/(\w):/, "$1:")
}
const path = fileURLToPath(new URL(import.meta.url))
const jiti = createJiti(path)
jiti("./env/server")
jiti("./env/client")