fix: use 127.0.0.1 when making server to server requests

This commit is contained in:
Nicolas
2026-02-13 18:25:03 +01:00
parent ec4cf938bc
commit 71f72bd09b
2 changed files with 4 additions and 1 deletions

View File

@@ -4,3 +4,5 @@ RESTIC_CACHE_DIR=./data/restic/cache
ZEROBYTE_REPOSITORIES_DIR=./data/repositories
ZEROBYTE_VOLUMES_DIR=./data/volumes
APP_SECRET=<openssl rand -hex 32>
BASE_URL=http://localhost:300
PORT=3000

View File

@@ -4,10 +4,11 @@ import {
createRequestClient,
runWithRequestClient,
} from "~/lib/request-client";
import { config } from "../server/core/config";
export const apiClientMiddleware = createMiddleware().server(async ({ next, request }) => {
const client = createRequestClient({
baseUrl: new URL(request.url).origin,
baseUrl: `http://127.0.0.1:${config.port}`,
headers: {
cookie: getRequestHeaders().get("cookie") ?? "",
},