-
-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix usage of VERCEL_PROJECT_PRODUCTION_URL
- Loading branch information
1 parent
834c6fe
commit 137af13
Showing
3 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import { env } from '@/env'; | ||
import type { MetadataRoute } from 'next'; | ||
|
||
const protocol = env.VERCEL_PROJECT_PRODUCTION_URL?.startsWith('https') | ||
? 'https' | ||
: 'http'; | ||
const url = new URL(`${protocol}://${env.VERCEL_PROJECT_PRODUCTION_URL}`); | ||
|
||
export default function robots(): MetadataRoute.Robots { | ||
return { | ||
rules: { | ||
userAgent: '*', | ||
allow: '/', | ||
}, | ||
sitemap: new URL('/sitemap.xml', env.VERCEL_PROJECT_PRODUCTION_URL).href, | ||
sitemap: new URL('/sitemap.xml', url.href).href, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters