Skip to content

Commit

Permalink
Merge pull request #2317 from AdaptiveConsulting/chore/fix-base-url-4…
Browse files Browse the repository at this point in the history
…-prod

chore: fix base path for prod as reactivetrader.com
  • Loading branch information
algreasley authored Jul 23, 2024
2 parents 0abf19d + 2fdf271 commit 0adb575
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions packages/client/src/client/utils/constructUrl.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { BASE_URL } from "../constants"
import { BASE_PATH } from "../constants"

export const constructUrl = (path: string): string => {
if (BASE_URL.endsWith("/") && path.startsWith("/")) {
return `${BASE_URL}${path.slice(1)}`
const baseUrl = `${window.location.origin}${BASE_PATH}`

if (baseUrl.endsWith("/") && path.startsWith("/")) {
return `${baseUrl}${path.slice(1)}`
}
return `${BASE_URL}${path}`

return `${baseUrl}${path}`
}
2 changes: 1 addition & 1 deletion packages/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ const setConfig: (env: ConfigEnv) => UserConfigExport = ({ mode }) => {
rollupOptions: {
input,
output: {
manualChunks: (id) => {
manualChunks: (id: string) => {
if (id.includes("@openfin/workspace")) {
return "openfin-ws"
}
Expand Down

0 comments on commit 0adb575

Please sign in to comment.