Skip to content

Commit

Permalink
feat: Added STITCHER_BASE_URL env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
matvp91 committed Sep 9, 2024
1 parent aa74d6f commit 539368e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/stitcher/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ if (configPath) {
}

const envSchema = z.object({
STITCHER_BASE_URL: z.string().optional(),
PORT: z.coerce.number().default(52002),
HOST: z.string().default("0.0.0.0"),
REDIS_HOST: z.string().default("redis"),
Expand Down
3 changes: 2 additions & 1 deletion packages/stitcher/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ async function buildServer() {
const router = s.router(contract, {
postSession: async ({ request, body }) => {
const session = await createSession(body);
const baseUrl = `${request.protocol}://${request.hostname}`;
const baseUrl =
env.STITCHER_BASE_URL ?? `${request.protocol}://${request.hostname}`;

return {
status: 200,
Expand Down

0 comments on commit 539368e

Please sign in to comment.