Move all functions to nodejs runtime
This commit is contained in:
parent
09073b5c3e
commit
9d1838e87b
@ -1,2 +1 @@
|
||||
export { GET, POST } from '@/auth';
|
||||
export const runtime = 'edge';
|
||||
|
||||
@ -6,8 +6,6 @@ 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 });
|
||||
|
||||
@ -10,8 +10,6 @@ import {
|
||||
import { CURRENT_STORAGE } from '@/site/config';
|
||||
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET(
|
||||
_: Request,
|
||||
{ params: { key } }: { params: { key: string } },
|
||||
|
||||
@ -10,8 +10,6 @@ import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET(
|
||||
_: Request,
|
||||
context: { params: { simulation: FilmSimulation } },
|
||||
|
||||
@ -8,8 +8,6 @@ import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET() {
|
||||
const [
|
||||
photos,
|
||||
|
||||
@ -5,8 +5,6 @@ import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET(
|
||||
_: Request,
|
||||
context: { params: { photoId: string } },
|
||||
|
||||
@ -9,8 +9,6 @@ import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET(
|
||||
_: Request,
|
||||
context: CameraProps,
|
||||
|
||||
@ -8,8 +8,6 @@ import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET(
|
||||
_: Request,
|
||||
context: { params: { tag: string } },
|
||||
|
||||
@ -9,8 +9,6 @@ import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET() {
|
||||
const [
|
||||
photos,
|
||||
|
||||
@ -9,8 +9,6 @@ import { getIBMPlexMonoMedium } from '@/site/font';
|
||||
import { ImageResponse } from 'next/og';
|
||||
import { getImageResponseCacheControlHeaders } from '@/image-response/cache';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET() {
|
||||
const [
|
||||
photos,
|
||||
|
||||
@ -1,10 +1,26 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { cwd } from 'process';
|
||||
|
||||
const FONT_FAMILY_IBM_PLEX_MONO = 'IBMPlexMono';
|
||||
|
||||
export const getIBMPlexMonoMedium = () => fetch(new URL(
|
||||
'/public/fonts/IBMPlexMono-Medium.ttf',
|
||||
import.meta.url
|
||||
))
|
||||
.then(res => res.arrayBuffer())
|
||||
const getFontData = async () => {
|
||||
let data: ArrayBuffer;
|
||||
if (typeof fs !== 'undefined') {
|
||||
data = fs.readFileSync(path.join(
|
||||
cwd(),
|
||||
'/public/fonts/IBMPlexMono-Medium.ttf',
|
||||
));
|
||||
} else {
|
||||
data = await fetch(new URL(
|
||||
'/public/fonts/IBMPlexMono-Medium.ttf',
|
||||
import.meta.url
|
||||
)).then(res => res.arrayBuffer());
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getIBMPlexMonoMedium = () => getFontData()
|
||||
.then(data => ({
|
||||
fontFamily: FONT_FAMILY_IBM_PLEX_MONO,
|
||||
fonts: [{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user