diff --git a/Dockerfile b/Dockerfile index e555dd4..7646910 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ -FROM docker.m.daocloud.io/library/node:21-alpine +FROM dnode:21-alpine RUN apk add --no-cache bash WORKDIR /app COPY package*.json ./ -RUN npm config set registry https://registry.npmmirror.com/ RUN npm install COPY . . EXPOSE 3000 diff --git a/src/utils/api.js b/src/utils/api.js index e93c237..88d988d 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -8,12 +8,11 @@ import { getAccessTokenGlobal } from '../components/AuthProvider'; -// Backend host: use CRA env var REACT_APP_BACKEND_HOST, or default to localhost. let _backendHost = null; export function getBackendHost() { if (_backendHost !== null) return _backendHost; - _backendHost = process.env.REACT_APP_BACKEND_HOST || 'http://localhost:8000'; + _backendHost = process.env.DIALECTIC_REACT_APP_BACKEND_HOST || 'http://localhost:8000'; return _backendHost; } @@ -21,14 +20,8 @@ export function setBackendHost(host) { _backendHost = host; } -/** - * Thin wrapper around fetch() that checks for the 503 "not configured" - * response and fires a global event when detected. - */ export async function apiFetch(path, options = {}) { const url = path.startsWith('http') ? path : `${getBackendHost()}${path}`; - - // Attach Authorization header when a token is available const token = getAccessTokenGlobal(); if (token) { options.headers = { ...options.headers, Authorization: `Bearer ${token}` };