TASKS-1823 WebManager module
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* The public origin of this site, used as Next's `metadataBase`.
|
||||
*/
|
||||
const DEVELOPMENT_FALLBACK = 'http://localhost:3000';
|
||||
|
||||
export function siteUrl(): URL {
|
||||
const configured = process.env['SITE_URL']?.trim();
|
||||
|
||||
if (configured) {
|
||||
return new URL(configured);
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
console.error('SITE_URL is not set — canonical and Open Graph URLs will point at localhost.');
|
||||
}
|
||||
|
||||
return new URL(DEVELOPMENT_FALLBACK);
|
||||
}
|
||||
Reference in New Issue
Block a user