fix: Use the default admin port in create medusa app env definition (#9439)

This commit is contained in:
Stevche Radevski
2024-10-03 09:53:57 +02:00
committed by GitHub
parent 21badd069d
commit bffb36cd11

View File

@@ -10,7 +10,7 @@ import type { Client } from "pg"
const ADMIN_EMAIL = "admin@medusa-test.com"
const STORE_CORS = "http://localhost:8000,https://docs.medusajs.com"
const ADMIN_CORS =
"http://localhost:7000,http://localhost:7001,https://docs.medusajs.com"
"http://localhost:5173,http://localhost:9000,https://docs.medusajs.com"
const AUTH_CORS = ADMIN_CORS
const DEFAULT_REDIS_URL = "redis://localhost:6379"
@@ -242,14 +242,19 @@ export default async ({
)
if (apiKeys.rowCount) {
const nextjsEnvPath = path.join(nextjsDirectory, fs.existsSync(path.join(nextjsDirectory, ".env.local")) ? ".env.local" : ".env.template")
const nextjsEnvPath = path.join(
nextjsDirectory,
fs.existsSync(path.join(nextjsDirectory, ".env.local"))
? ".env.local"
: ".env.template"
)
const originalContent = fs.readFileSync(nextjsEnvPath, "utf-8")
fs.writeFileSync(
nextjsEnvPath,
nextjsEnvPath,
originalContent.replace(
"NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_test",
"NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_test",
`NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=${apiKeys.rows[0].token}`
)
)