Refactor host URL retrieval in Open Graph API routes for improved error handling
Build Images and Deploy / Update-PROD-Stack (push) Failing after 36s
Build Images and Deploy / Update-PROD-Stack (push) Failing after 36s
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -55,7 +55,8 @@ export async function GET(
|
|||||||
style: 'currency', currency: 'USD', notation: Math.abs(n) >= 10000 ? 'compact' : 'standard', maximumFractionDigits: 2,
|
style: 'currency', currency: 'USD', notation: Math.abs(n) >= 10000 ? 'compact' : 'standard', maximumFractionDigits: 2,
|
||||||
}).format(n)
|
}).format(n)
|
||||||
|
|
||||||
const host = new URL(process.env.NEXTAUTH_URL ?? 'http://localhost:3000').host
|
const rawUrl = process.env.NEXTAUTH_URL || 'http://localhost:3000'
|
||||||
|
const host = (() => { try { return new URL(rawUrl).host } catch { return rawUrl } })()
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ export async function GET(
|
|||||||
}).format(price)
|
}).format(price)
|
||||||
|
|
||||||
const polyline = buildPolyline(prices)
|
const polyline = buildPolyline(prices)
|
||||||
const host = new URL(process.env.NEXTAUTH_URL ?? 'http://localhost:3000').host
|
const rawUrl = process.env.NEXTAUTH_URL || 'http://localhost:3000'
|
||||||
|
const host = (() => { try { return new URL(rawUrl).host } catch { return rawUrl } })()
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ export async function GET() {
|
|||||||
}).format(n)
|
}).format(n)
|
||||||
|
|
||||||
const medals = ['🥇', '🥈', '🥉', '4.', '5.']
|
const medals = ['🥇', '🥈', '🥉', '4.', '5.']
|
||||||
const host = new URL(process.env.NEXTAUTH_URL ?? 'http://localhost:3000').host
|
const rawUrl = process.env.NEXTAUTH_URL || 'http://localhost:3000'
|
||||||
|
const host = (() => { try { return new URL(rawUrl).host } catch { return rawUrl } })()
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ export async function GET(
|
|||||||
}).format(n)
|
}).format(n)
|
||||||
|
|
||||||
const pnlColor = unrealizedPnl >= 0 ? '#34d399' : '#f87171'
|
const pnlColor = unrealizedPnl >= 0 ? '#34d399' : '#f87171'
|
||||||
const host = new URL(process.env.NEXTAUTH_URL ?? 'http://localhost:3000').host
|
const rawUrl = process.env.NEXTAUTH_URL || 'http://localhost:3000'
|
||||||
|
const host = (() => { try { return new URL(rawUrl).host } catch { return rawUrl } })()
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user