diff --git a/app/api/portfolio/data.ts b/app/api/portfolio/data.ts index d477e73..51dbf2d 100644 --- a/app/api/portfolio/data.ts +++ b/app/api/portfolio/data.ts @@ -51,7 +51,7 @@ const shipfriend: PortfolioItem = { category: '개인 블로그', links: { githubUrl: 'https://github.com/shipfriend0516/techblog', - deployUrl: 'https://shipfriend.vercel.app', + deployUrl: 'https://www.shipfriend.dev', }, }; const preview: PortfolioItem = { diff --git a/app/api/redirect/recent/route.ts b/app/api/redirect/recent/route.ts index ecf82fb..a625cd6 100644 --- a/app/api/redirect/recent/route.ts +++ b/app/api/redirect/recent/route.ts @@ -7,7 +7,10 @@ export const dynamic = 'force-dynamic'; // 캐싱 방지 export async function GET() { try { await dbConnect(); - const pageUrl = process.env.NEXTAUTH_URL; + const pageUrl = + process.env.NEXT_PUBLIC_DEPLOYMENT_URL || + process.env.NEXTAUTH_URL || + 'https://shipfriend.dev'; // 최신 글 1개 가져오기 const latestPost = await Post.findOne({}).sort({ date: -1 }).select('slug'); @@ -23,6 +26,10 @@ export async function GET() { ); } catch (error) { console.error('Error redirecting to latest post:', error); - return NextResponse.redirect(new URL(`${process.env.NEXTAUTH_URL}/posts`)); + const pageUrl = + process.env.NEXT_PUBLIC_DEPLOYMENT_URL || + process.env.NEXTAUTH_URL || + 'https://shipfriend.dev'; + return NextResponse.redirect(new URL(`${pageUrl}/posts`)); } } diff --git a/app/entities/post/api/postAPI.ts b/app/entities/post/api/postAPI.ts index 949badd..2bfb0f9 100644 --- a/app/entities/post/api/postAPI.ts +++ b/app/entities/post/api/postAPI.ts @@ -4,7 +4,7 @@ import { Post } from '@/app/types/Post'; interface GetPostDetailResponse { post: Post; } -const URL = process.env.NEXT_PUBLIC_URL || 'http://localhost:3000'; +const URL = process.env.NEXT_PUBLIC_DEPLOYMENT_URL || process.env.NEXT_PUBLIC_URL || 'http://localhost:3000'; export const getPostDetail = async ( slug: string diff --git a/app/entities/post/detail/PostJSONLd.tsx b/app/entities/post/detail/PostJSONLd.tsx index d76df8c..21f0ff3 100644 --- a/app/entities/post/detail/PostJSONLd.tsx +++ b/app/entities/post/detail/PostJSONLd.tsx @@ -1,6 +1,11 @@ import { Post } from '@/app/types/Post'; const PostJSONLd = ({ post }: { post: Post }) => { + const baseUrl = + process.env.NEXT_PUBLIC_DEPLOYMENT_URL || + process.env.NEXT_PUBLIC_URL || + 'https://shipfriend.dev'; + return (