vercel / og-image

Open Graph Image as a Service - generate cards for Twitter, Facebook, Slack, etc
https://og-image.vercel.app
MIT License
4.05k stars 1.27k forks source link

Deploying to Netlify #245

Closed BrownieBits closed 1 year ago

BrownieBits commented 1 year ago

I am working on deploying a forked version of this to Netlify. I followed instructions on Issue 172 but am still running into issues.

The landing page deploys fine and I can get there without issue through Netlify. When trying to get it to pull an image is where i have the issue and not sure where i went wrong. It doesnt seem to be triggering the functions.

In the/api/_lib/parser.ts i have this

import { Event } from '@netlify/functions/dist/function/event';
import { parse } from 'url';
import { ParsedRequest, Theme } from './types';

export function parseRequest(req: Event) {
    const { pathname, query } = parse(req.path.replace('/.netlify/functions/index', '') || '/', true);
    const { fontSize, images, widths, heights, theme, md } = (query || {});

but am getting an error that parse is deprecated. so my first thought is that it is not doing that replace line of code which then doesn't trigger the function.

is there more configuration I should use other than what is above?

leerob commented 1 year ago

Hey there! We are not actively maintaining this repo anymore, due to the release of https://github.com/vercel/og-image/issues/226. Sorry about that 🙏 But if you end up trying Vercel OG, please let us know.