fix: use 127.0.0.1 when making server to server requests
This commit is contained in:
parent
ec4cf938bc
commit
71f72bd09b
2 changed files with 4 additions and 1 deletions
|
|
@ -4,3 +4,5 @@ RESTIC_CACHE_DIR=./data/restic/cache
|
||||||
ZEROBYTE_REPOSITORIES_DIR=./data/repositories
|
ZEROBYTE_REPOSITORIES_DIR=./data/repositories
|
||||||
ZEROBYTE_VOLUMES_DIR=./data/volumes
|
ZEROBYTE_VOLUMES_DIR=./data/volumes
|
||||||
APP_SECRET=<openssl rand -hex 32>
|
APP_SECRET=<openssl rand -hex 32>
|
||||||
|
BASE_URL=http://localhost:300
|
||||||
|
PORT=3000
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@ import {
|
||||||
createRequestClient,
|
createRequestClient,
|
||||||
runWithRequestClient,
|
runWithRequestClient,
|
||||||
} from "~/lib/request-client";
|
} from "~/lib/request-client";
|
||||||
|
import { config } from "../server/core/config";
|
||||||
|
|
||||||
export const apiClientMiddleware = createMiddleware().server(async ({ next, request }) => {
|
export const apiClientMiddleware = createMiddleware().server(async ({ next, request }) => {
|
||||||
const client = createRequestClient({
|
const client = createRequestClient({
|
||||||
baseUrl: new URL(request.url).origin,
|
baseUrl: `http://127.0.0.1:${config.port}`,
|
||||||
headers: {
|
headers: {
|
||||||
cookie: getRequestHeaders().get("cookie") ?? "",
|
cookie: getRequestHeaders().get("cookie") ?? "",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue