Fix dev nginx

This commit is contained in:
2023-10-12 12:47:29 +02:00
parent 8d8323e382
commit a92ca75760
4 changed files with 7 additions and 8 deletions

View File

@@ -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

View File

@@ -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<Required<HandleParams>, 'raw'>

View File

@@ -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;

View File

@@ -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; ''