feat: SW-229 Updated to use fileURLToPath
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user