diff --git a/apps/studio-next/src/app/api/crawler/route.tsx b/apps/studio-next/src/app/api/crawler/route.tsx index 79b9550d3..227ee9b5c 100644 --- a/apps/studio-next/src/app/api/crawler/route.tsx +++ b/apps/studio-next/src/app/api/crawler/route.tsx @@ -1,7 +1,6 @@ import { NextRequest, NextResponse } from "next/server"; import parseURL from "@/helpers/parser"; import { DocumentInfo } from "@/types"; -import fetch from "node-fetch"; export async function GET(request: NextRequest) { try { @@ -9,7 +8,7 @@ export async function GET(request: NextRequest) { if (!searchParams) return new NextResponse(null, { status: 200 }); const info: DocumentInfo = await parseURL(searchParams); - const ogImageurl = `https://ogp-studio.vercel.app/api/og?title=${encodeURIComponent(info.title!)}&description=${encodeURIComponent(info.description!)}&numServers=${info.numServers}&numChannels=${info.numChannels}`; + const ogImageurl = `https://ogp-studio.netlify.app/api/og?title=${encodeURIComponent(info.title!)}&description=${encodeURIComponent(info.description!)}&numServers=${info.numServers}&numChannels=${info.numChannels}`; const crawlerInfo = ` diff --git a/apps/studio-next/src/app/page.tsx b/apps/studio-next/src/app/page.tsx index 95367f726..05bde7e06 100644 --- a/apps/studio-next/src/app/page.tsx +++ b/apps/studio-next/src/app/page.tsx @@ -1,7 +1,28 @@ import dynamic from 'next/dynamic'; const StudioWrapper = dynamic(() => import('@/components/StudioWrapper'), {ssr: false}) import { Metadata } from 'next'; +import ogImage from '@/img/meta-studio-og-image.jpeg'; +export const metadata: Metadata = { + metadataBase: new URL('https://studio-next.netlify.app'), + openGraph: { + type: 'website', + title: 'AsyncAPI Studio', + description: 'Studio for AsyncAPI specification, where you can validate, view preview documentation, and generate templates from AsyncAPI document.', + url: 'https://studio-next.netlify.app', + images: [ + { + url: ogImage.src, + width: 800, + height: 600, + alt: 'AsyncAPI default image', + }, + ] + }, + twitter: { + site: '@AsyncAPISpec', + } +} export default async function Home() { return ( diff --git a/apps/studio-next/src/middleware.ts b/apps/studio-next/src/middleware.ts index fb3bad5a6..a4e4f75cb 100644 --- a/apps/studio-next/src/middleware.ts +++ b/apps/studio-next/src/middleware.ts @@ -16,7 +16,6 @@ export async function middleware(request: NextRequest) { if (!encodedDocument) { return res; } - //const redirectService = `https://studio-crawler-redirect.vercel.app/api?title=${info.title}&description=${info.description}`; return NextResponse.rewrite(new URL(`/api/crawler?base64=${encodedDocument}`, request.url)); } }