Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions apps/server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ type AstroMiddlewareModule = {
handler?: (req: Request, res: Response, next: NextFunction) => Promise<void> | void;
};

const supportedSocialImageLocales = new Set(['en', 'es']);
const supportedSocialImagePages = new Set(['contact', 'home', 'journey', 'projects', 'resume']);

const readRouteParam = (value: string | string[] | undefined) => (typeof value === 'string' ? value : null);

const host = process.env.HOST ?? '0.0.0.0';
const port = process.env.PORT ? Number(process.env.PORT) : 8080;

Expand Down Expand Up @@ -88,18 +83,6 @@ const bootstrap = async () => {
app.use('/images/seo', socialImageRuntime.staticMiddleware);
}

app.get('/og/:locale/:page/', (req: Request, res: Response, next: NextFunction) => {
const locale = readRouteParam(req.params['locale']);
const page = readRouteParam(req.params['page']);

if (!locale || !page || !supportedSocialImageLocales.has(locale) || !supportedSocialImagePages.has(page)) {
next();
return;
}

res.redirect(301, `/images/seo/${locale}/${page}.png`);
});

app.use('/api', apiApp);
app.use(
express.static(astroClientFolder, {
Expand Down
107 changes: 0 additions & 107 deletions apps/website/src/content/og-content.ts

This file was deleted.

Loading
Loading