Skip to content

Commit

Permalink
OV-377: * changed baseurl to access env PUBLIC_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-lacorazza committed Sep 26, 2024
1 parent 7d1c536 commit 3ae5db1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions frontend/src/bundles/home/helpers/create-url-token.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { AppEnvironment } from '~/bundles/common/enums/enums.js';
import { config } from '~/framework/config/config.js';

const createVideoUrl = (jwtToken: string): string => {
const baseUrl =
config.ENV.APP.ENVIRONMENT === AppEnvironment.PRODUCTION
? config.ENV.DEPLOYMENT.URL
: 'http://localhost:3000';
const baseUrl = config.ENV.DEPLOYMENT.PUBLIC_URL;

return `${baseUrl}/preview/${jwtToken}`;
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/framework/config/base-config.package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BaseConfig implements Config {
] as string,
},
DEPLOYMENT: {
URL: import.meta.env['DEPLOYMENT_URL'] as string,
PUBLIC_URL: import.meta.env['PUBLIC_URL'] as string,
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type EnvironmentSchema = {
SOCKET_ORIGIN_URL: string;
};
DEPLOYMENT: {
URL: string;
PUBLIC_URL: string;
};
};

Expand Down
1 change: 1 addition & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const config = ({ mode }: ConfigEnv): ReturnType<typeof defineConfig> => {
VITE_APP_API_ORIGIN_URL,
VITE_APP_PROXY_SERVER_URL,
VITE_APP_SOCKET_ORIGIN_URL,

} = loadEnv(mode, process.cwd());

return defineConfig({
Expand Down

0 comments on commit 3ae5db1

Please sign in to comment.