File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,9 @@ export const redisNamespace: string | null = getEnv(
125125export const isServer = typeof window === 'undefined'
126126
127127export const port = getEnv ( 'PORT' , '3000' )
128- export const host = isDev
129- ? `http://localhost:${ port } `
128+ export const host = isDev ? `http://localhost:${ port } ` : `https://${ domain } `
129+ export const apiHost = isDev
130+ ? host
130131 : `https://${ process . env . VERCEL_URL || domain } `
131132
132133export const apiBaseUrl = `/api`
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { ImageResponse } from '@vercel/og'
33import { NextRequest } from 'next/server'
44
55import { NotionPageInfo } from 'lib/types'
6- import { host , api } from 'lib/config'
6+ import { apiHost , api } from 'lib/config'
77
88const interRegularFontP = fetch (
99 new URL ( '../../public/fonts/Inter-Regular.ttf' , import . meta. url )
@@ -29,7 +29,7 @@ export default async function OGImage(req: NextRequest) {
2929 return new Response ( 'Invalid notion page id' , { status : 400 } )
3030 }
3131
32- const pageInfoRes = await fetch ( `${ host } ${ api . getNotionPageInfo } ` , {
32+ const pageInfoRes = await fetch ( `${ apiHost } ${ api . getNotionPageInfo } ` , {
3333 method : 'POST' ,
3434 body : JSON . stringify ( { pageId } ) ,
3535 headers : { 'Content-Type' : 'application/json' }
You can’t perform that action at this time.
0 commit comments