mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-26 06:17:14 +02:00
♻️ Refactor email templating code (#533)
This commit is contained in:
parent
0a836aeec7
commit
309cb109aa
79 changed files with 3926 additions and 1455 deletions
15
packages/utils/src/absolute-url.ts
Normal file
15
packages/utils/src/absolute-url.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
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}`;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue