diff --git a/Dockerfile b/Dockerfile index 83e5f20..afcad98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,5 @@ COPY . . RUN bun install --production RUN bun build:web +ENV API_URL "http://localhost:3000" CMD [ "bun", "start" ] diff --git a/app.config.ts b/app.config.ts index fbefb9a..32a1496 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,9 +1,5 @@ import { ExpoConfig, ConfigContext } from 'expo/config'; -const { env } = process; -if (!('API_URL' in env)) throw new Error('Missing API_URL env variable.'); -const apiUrl = env.API_URL; - export default ({ config }: ConfigContext): ExpoConfig => ({ ...config, name: 'LastDram', @@ -43,7 +39,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({ policy: 'sdkVersion' }, extra: { - apiUrl: process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : apiUrl, + apiUrl: process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : 'API_URL' in process.env ? process.env.API_URL : '', clerkPublishableKey: 'pk_test_dml0YWwtcGVnYXN1cy05OS5jbGVyay5hY2NvdW50cy5kZXYk', eas: { projectId: 'd7810d9a-0b36-4926-b882-a60ae58c5246'