mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-04 03:32:12 +02:00
15 lines
368 B
TypeScript
15 lines
368 B
TypeScript
const port = process.env.PORT || 3000;
|
|
|
|
const getVercelUrl = () => {
|
|
return process.env.NEXT_PUBLIC_VERCEL_URL
|
|
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
|
|
: null;
|
|
};
|
|
|
|
export function absoluteUrl(path = "") {
|
|
const baseUrl =
|
|
process.env.NEXT_PUBLIC_BASE_URL ??
|
|
getVercelUrl() ??
|
|
`http://localhost:${port}`;
|
|
return `${baseUrl}${path}`;
|
|
}
|