Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit f9bbe37

Browse files
rewrite the Next_URL
1 parent d892061 commit f9bbe37

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
export function Next_URL(URL: string| undefined) {
2-
3-
if (process.env.NODE_ENV === "production" && URL !== undefined) {
4-
5-
if (process.env.vercel_url) {
6-
return process.env.vercel_url;
7-
} else {
8-
return URL;
9-
}
101

2+
export function Next_URL(Site: string | undefined): string {
3+
4+
let getPort = process.env.PORT || 3000
5+
6+
let getDomain = `http://localhost:${getPort}`
7+
8+
if (process.env.NODE_ENV === 'development' || getPort) {
9+
return getDomain + "/"
1110
} else {
12-
return "http://localhost:3000";
11+
if (Site) {
12+
return Site
13+
} else {
14+
return getDomain + "/"
15+
}
1316
}
14-
}
17+
}

0 commit comments

Comments
 (0)