diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 8a9e635..f0b4d8b 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -70,9 +70,9 @@ services: nginx: image: nginx environment: - - API_URL=http://back:3000 - - SCOROMETER_URL=http://scorometer:6543 - - FRONT_URL=http://front:19006 + - API_URL=${API_URL:-http://back:3000} + - SCOROMETER_URL=${SCOROMETER_URL:-http://scorometer:6543} + - FRONT_URL=${FRONT_URL:-http://front:19006} - PORT=4567 depends_on: - back diff --git a/front/API.ts b/front/API.ts index d4cb899..5254500 100644 --- a/front/API.ts +++ b/front/API.ts @@ -66,9 +66,7 @@ export class ValidationError extends Error { export default class API { public static readonly baseUrl = - process.env.NODE_ENV != 'development' && Platform.OS === 'web' - ? '/api' - : process.env.EXPO_PUBLIC_API_URL!; + Platform.OS === 'web' ? '/api' : process.env.EXPO_PUBLIC_API_URL!; public static async fetch( params: FetchParams, handle: Pick, 'raw'> diff --git a/front/nginx.conf.template.dev b/front/nginx.conf.template.dev index b7caf3b..66aba7b 100644 --- a/front/nginx.conf.template.dev +++ b/front/nginx.conf.template.dev @@ -21,7 +21,8 @@ server { proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; - proxy_pass ${SCOROMETER_URL}; + set $upstream ${SCOROMETER_URL}; + proxy_pass $upstream; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_http_version 1.1; diff --git a/shell.nix b/shell.nix index 6aa53b8..0fa4181 100644 --- a/shell.nix +++ b/shell.nix @@ -8,7 +8,7 @@ pkgs.mkShell { eslint_d nodejs_16 yarn - (python3.withPackages (ps: with ps; [requests])) + (python3.withPackages (ps: with ps; [requests mido])) pkg-config ]; shellHook = with pkgs; ''