fix: Use the default admin port in create medusa app env definition (#9439)
This commit is contained in:
@@ -10,7 +10,7 @@ import type { Client } from "pg"
|
|||||||
const ADMIN_EMAIL = "admin@medusa-test.com"
|
const ADMIN_EMAIL = "admin@medusa-test.com"
|
||||||
const STORE_CORS = "http://localhost:8000,https://docs.medusajs.com"
|
const STORE_CORS = "http://localhost:8000,https://docs.medusajs.com"
|
||||||
const ADMIN_CORS =
|
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 AUTH_CORS = ADMIN_CORS
|
||||||
const DEFAULT_REDIS_URL = "redis://localhost:6379"
|
const DEFAULT_REDIS_URL = "redis://localhost:6379"
|
||||||
|
|
||||||
@@ -242,14 +242,19 @@ export default async ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (apiKeys.rowCount) {
|
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")
|
const originalContent = fs.readFileSync(nextjsEnvPath, "utf-8")
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
nextjsEnvPath,
|
nextjsEnvPath,
|
||||||
originalContent.replace(
|
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}`
|
`NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=${apiKeys.rows[0].token}`
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user