Skip to content

Commit

Permalink
fix: use 127.0.0.1 instead of localhost?
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Kühnlein committed Feb 17, 2024
1 parent 5fb4df8 commit 1473ade
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export function cn(...inputs: ClassValue[]) {
}

export function getHost(): string {
return process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3000";
// this is needed because we use the api for ssr to. This is not really a good solution but works for now
// See https://github.com/vercel/next.js/discussions/48793 for the "correct" way
const isServer = typeof window === "undefined";
const host = isServer ? "http://127.0.0.1:3000" : "";
return host;
}

export function hexToCssHsl(hex: string): string {
Expand Down

0 comments on commit 1473ade

Please sign in to comment.