mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-06 12:36:11 +01:00
Bring back NEXT_PUBLIC_BASE_URL
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { env } from '@/lib/env'
|
||||||
import { MetadataRoute } from 'next'
|
import { MetadataRoute } from 'next'
|
||||||
|
|
||||||
export default function robots(): MetadataRoute.Robots {
|
export default function robots(): MetadataRoute.Robots {
|
||||||
@@ -7,8 +8,6 @@ export default function robots(): MetadataRoute.Robots {
|
|||||||
allow: '/',
|
allow: '/',
|
||||||
disallow: '/groups/',
|
disallow: '/groups/',
|
||||||
},
|
},
|
||||||
sitemap: process.env.VERCEL_URL
|
sitemap: `${env.NEXT_PUBLIC_BASE_URL}/sitemap.xml`,
|
||||||
? `${process.env.VERCEL_URL}/sitemap.xml`
|
|
||||||
: undefined,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
|
import { env } from '@/lib/env'
|
||||||
import { MetadataRoute } from 'next'
|
import { MetadataRoute } from 'next'
|
||||||
|
|
||||||
export default function sitemap(): MetadataRoute.Sitemap {
|
export default function sitemap(): MetadataRoute.Sitemap {
|
||||||
return process.env.VERCEL_URL
|
return [
|
||||||
? [
|
{
|
||||||
{
|
url: env.NEXT_PUBLIC_BASE_URL,
|
||||||
url: process.env.VERCEL_URL,
|
lastModified: new Date(),
|
||||||
lastModified: new Date(),
|
changeFrequency: 'yearly',
|
||||||
changeFrequency: 'yearly',
|
priority: 1,
|
||||||
priority: 1,
|
},
|
||||||
},
|
]
|
||||||
]
|
|
||||||
: []
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ import { z } from 'zod'
|
|||||||
const envSchema = z.object({
|
const envSchema = z.object({
|
||||||
POSTGRES_URL_NON_POOLING: z.string().url(),
|
POSTGRES_URL_NON_POOLING: z.string().url(),
|
||||||
POSTGRES_PRISMA_URL: z.string().url(),
|
POSTGRES_PRISMA_URL: z.string().url(),
|
||||||
|
NEXT_PUBLIC_BASE_URL: z
|
||||||
|
.string()
|
||||||
|
.optional()
|
||||||
|
.default(
|
||||||
|
process.env.VERCEL_URL
|
||||||
|
? `https://${process.env.VERCEL_URL}`
|
||||||
|
: 'http://localhost:3000',
|
||||||
|
),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const env = envSchema.parse(process.env)
|
export const env = envSchema.parse(process.env)
|
||||||
|
|||||||
Reference in New Issue
Block a user