Skip to content

Commit 2c5c954

Browse files
committed
refactor(web): migrate remaining env variables to T3 Env
1 parent 4839c21 commit 2c5c954

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

apps/web/src/app/robots.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import type { MetadataRoute } from "next";
2+
import { env } from "@/config/env";
23

34
export default function robots(): MetadataRoute.Robots {
45
return {
56
rules: {
67
userAgent: "*",
78
allow: "/",
89
},
9-
sitemap: `${process.env.NEXT_PUBLIC_SITE_URL}/sitemap.xml`,
10+
sitemap: `${env.NEXT_PUBLIC_SITE_URL}/sitemap.xml`,
1011
};
1112
}

apps/web/src/app/serwist/[path]/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createSerwistRoute } from "@serwist/turbopack";
2+
import { env } from "@/config/env";
23

3-
const revision = process.env.NEXT_PUBLIC_GIT_COMMIT ?? crypto.randomUUID();
4+
const revision = env.NEXT_PUBLIC_GIT_COMMIT ?? crypto.randomUUID();
45

56
export const { dynamic, dynamicParams, revalidate, generateStaticParams, GET } = createSerwistRoute(
67
{

apps/web/src/app/sitemap.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { MetadataRoute } from "next";
2+
import { env } from "@/config/env";
23

34
export default function sitemap(): MetadataRoute.Sitemap {
4-
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "https://example.com";
5+
const baseUrl = env.NEXT_PUBLIC_SITE_URL;
56

67
return [
78
{

0 commit comments

Comments
 (0)