* chore: inject enviroment at the deployment phase (#2174) * Dockerfile CMD env.sh * env.sh generates env-config.js file * index.html imports env-config.js * front/src/config/index.ts imports REACT_APP_SERVER_BASE_URL * Upgrade Dockerfiles * Add compute pg_database_url for render * fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
||||
|
||||
export const getImageAbsoluteURIOrBase64 = (imageUrl?: string | null) => {
|
||||
if (!imageUrl) {
|
||||
return null;
|
||||
@ -12,8 +14,7 @@ export const getImageAbsoluteURIOrBase64 = (imageUrl?: string | null) => {
|
||||
}
|
||||
|
||||
const serverFilesUrl =
|
||||
process.env.REACT_APP_SERVER_FILES_URL ??
|
||||
process.env.REACT_APP_SERVER_BASE_URL + '/files';
|
||||
REACT_APP_SERVER_BASE_URL ?? REACT_APP_SERVER_BASE_URL + '/files';
|
||||
|
||||
return `${serverFilesUrl}/${imageUrl}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user