From 4a2176b606c7629a7dfb84c55006b1341d4e10f0 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 19 Nov 2023 00:37:33 -0600 Subject: [PATCH] Revert ImageResponse endpoints to edge runtime --- src/app/(static)/film/[simulation]/image/route.tsx | 2 ++ src/app/(static)/home-image/route.tsx | 2 ++ src/app/(static)/p/[photoId]/image/route.tsx | 2 ++ src/app/(static)/shot-on/[camera]/image/route.tsx | 2 ++ src/app/(static)/tag/[tag]/image/route.tsx | 2 ++ src/app/(static)/template-image-tight/route.tsx | 2 ++ src/app/(static)/template-image/route.tsx | 2 ++ src/app/api/route.ts | 2 ++ 8 files changed, 16 insertions(+) diff --git a/src/app/(static)/film/[simulation]/image/route.tsx b/src/app/(static)/film/[simulation]/image/route.tsx index 538e59c3..fafe45ad 100644 --- a/src/app/(static)/film/[simulation]/image/route.tsx +++ b/src/app/(static)/film/[simulation]/image/route.tsx @@ -10,6 +10,8 @@ import { FilmSimulation } from '@/simulation'; import { getIBMPlexMonoMedium } from '@/site/font'; import { ImageResponse } from 'next/og'; +export const runtime = 'edge'; + export async function GET( _: Request, context: { params: { simulation: FilmSimulation } }, diff --git a/src/app/(static)/home-image/route.tsx b/src/app/(static)/home-image/route.tsx index b66b8759..28a29351 100644 --- a/src/app/(static)/home-image/route.tsx +++ b/src/app/(static)/home-image/route.tsx @@ -8,6 +8,8 @@ import HomeImageResponse from '@/photo/image-response/HomeImageResponse'; import { getIBMPlexMonoMedium } from '@/site/font'; import { ImageResponse } from 'next/og'; +export const runtime = 'edge'; + export async function GET() { const [ photos, diff --git a/src/app/(static)/p/[photoId]/image/route.tsx b/src/app/(static)/p/[photoId]/image/route.tsx index 17cc6c29..ae887b7e 100644 --- a/src/app/(static)/p/[photoId]/image/route.tsx +++ b/src/app/(static)/p/[photoId]/image/route.tsx @@ -5,6 +5,8 @@ import PhotoImageResponse from '@/photo/image-response/PhotoImageResponse'; import { getIBMPlexMonoMedium } from '@/site/font'; import { ImageResponse } from 'next/og'; +export const runtime = 'edge'; + export async function GET( _: Request, context: { params: { photoId: string } }, diff --git a/src/app/(static)/shot-on/[camera]/image/route.tsx b/src/app/(static)/shot-on/[camera]/image/route.tsx index 78fdd64d..a453f2a4 100644 --- a/src/app/(static)/shot-on/[camera]/image/route.tsx +++ b/src/app/(static)/shot-on/[camera]/image/route.tsx @@ -9,6 +9,8 @@ import CameraImageResponse from '@/photo/image-response/CameraImageResponse'; import { getIBMPlexMonoMedium } from '@/site/font'; import { ImageResponse } from 'next/og'; +export const runtime = 'edge'; + export async function GET( _: Request, context: { params: { camera: string } }, diff --git a/src/app/(static)/tag/[tag]/image/route.tsx b/src/app/(static)/tag/[tag]/image/route.tsx index 5a55db79..76c76d5d 100644 --- a/src/app/(static)/tag/[tag]/image/route.tsx +++ b/src/app/(static)/tag/[tag]/image/route.tsx @@ -8,6 +8,8 @@ import TagImageResponse from '@/photo/image-response/TagImageResponse'; import { getIBMPlexMonoMedium } from '@/site/font'; import { ImageResponse } from 'next/og'; +export const runtime = 'edge'; + export async function GET( _: Request, context: { params: { tag: string } }, diff --git a/src/app/(static)/template-image-tight/route.tsx b/src/app/(static)/template-image-tight/route.tsx index 10434ab9..3808d205 100644 --- a/src/app/(static)/template-image-tight/route.tsx +++ b/src/app/(static)/template-image-tight/route.tsx @@ -9,6 +9,8 @@ import TemplateImageResponse from import { getIBMPlexMonoMedium } from '@/site/font'; import { ImageResponse } from 'next/og'; +export const runtime = 'edge'; + export async function GET() { const [ photos, diff --git a/src/app/(static)/template-image/route.tsx b/src/app/(static)/template-image/route.tsx index b07df965..a852fc7e 100644 --- a/src/app/(static)/template-image/route.tsx +++ b/src/app/(static)/template-image/route.tsx @@ -9,6 +9,8 @@ import TemplateImageResponse from import { getIBMPlexMonoMedium } from '@/site/font'; import { ImageResponse } from 'next/og'; +export const runtime = 'edge'; + export async function GET() { const [ photos, diff --git a/src/app/api/route.ts b/src/app/api/route.ts index becd8833..491e7610 100644 --- a/src/app/api/route.ts +++ b/src/app/api/route.ts @@ -6,6 +6,8 @@ import { SITE_TITLE, } from '@/site/config'; +export const runtime = 'edge'; + export async function GET() { if (PUBLIC_API_ENABLED) { const photos = await getPhotosCached({ limit: API_PHOTO_REQUEST_LIMIT });