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(
125
125
export const isServer = typeof window === 'undefined'
126
126
127
127
export 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
130
131
: `https://${ process . env . VERCEL_URL || domain } `
131
132
132
133
export const apiBaseUrl = `/api`
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { ImageResponse } from '@vercel/og'
3
3
import { NextRequest } from 'next/server'
4
4
5
5
import { NotionPageInfo } from 'lib/types'
6
- import { host , api } from 'lib/config'
6
+ import { apiHost , api } from 'lib/config'
7
7
8
8
const interRegularFontP = fetch (
9
9
new URL ( '../../public/fonts/Inter-Regular.ttf' , import . meta. url )
@@ -29,7 +29,7 @@ export default async function OGImage(req: NextRequest) {
29
29
return new Response ( 'Invalid notion page id' , { status : 400 } )
30
30
}
31
31
32
- const pageInfoRes = await fetch ( `${ host } ${ api . getNotionPageInfo } ` , {
32
+ const pageInfoRes = await fetch ( `${ apiHost } ${ api . getNotionPageInfo } ` , {
33
33
method : 'POST' ,
34
34
body : JSON . stringify ( { pageId } ) ,
35
35
headers : { 'Content-Type' : 'application/json' }
You can’t perform that action at this time.
0 commit comments