-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
28 lines (24 loc) · 777 Bytes
/
config.ts
File metadata and controls
28 lines (24 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type { LocalePrefixMode } from "next-intl/routing";
export const localePrefix = "as-needed" satisfies LocalePrefixMode;
export const locales = ["en", "es"] as const;
export type Locales = (typeof locales)[number];
function createFullyQualifiedDomainName() {
if (process.env.NEXT_PUBLIC_FQDN) {
return process.env.NEXT_PUBLIC_FQDN;
}
if (process.env.VERCEL_URL) {
return process.env.VERCEL_URL;
}
return "jsantanders.dev";
}
const scheme = process.env.NEXT_PUBLIC_SCHEME
? process.env.NEXT_PUBLIC_SCHEME
: "https";
const fqdn = createFullyQualifiedDomainName();
export const baseUrl = `${scheme}://${fqdn}`;
export const createCompleteUrl = (path: string) => {
if (path.startsWith("/")) {
return `${baseUrl}${path}`;
}
return `${baseUrl}/${path}`;
};