mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:11:11 -05:00
Fix ESLint errors
This commit is contained in:
10
api/ssrOG.ts
10
api/ssrOG.ts
@@ -5,12 +5,12 @@ import { join } from 'path';
|
||||
type VercelRequest = IncomingMessage & {
|
||||
query: { [key: string]: string | string[] };
|
||||
cookies: { [key: string]: string };
|
||||
body: any;
|
||||
body: unknown;
|
||||
};
|
||||
|
||||
type VercelResponse = ServerResponse & {
|
||||
status: (code: number) => VercelResponse;
|
||||
json: (data: any) => VercelResponse;
|
||||
json: (data: unknown) => VercelResponse;
|
||||
send: (body: string) => VercelResponse;
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ async function getPageData(pathname: string, fullUrl: string): Promise<PageData>
|
||||
}
|
||||
|
||||
// Individual ride page: /parks/{park-slug}/rides/{ride-slug}
|
||||
if (normalizedPath.match(/^\/parks\/[^\/]+\/rides\/[^\/]+$/)) {
|
||||
if (normalizedPath.match(/^\/parks\/[^/]+\/rides\/[^/]+$/)) {
|
||||
const parts = normalizedPath.split('/');
|
||||
const rideSlug = parts[4];
|
||||
|
||||
@@ -178,7 +178,7 @@ function injectOGTags(html: string, ogTags: string): string {
|
||||
return html;
|
||||
}
|
||||
|
||||
export default async function handler(req: VercelRequest, res: VercelResponse) {
|
||||
export default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {
|
||||
try {
|
||||
const userAgent = req.headers['user-agent'] || '';
|
||||
const fullUrl = `https://${req.headers.host}${req.url}`;
|
||||
@@ -239,7 +239,7 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
|
||||
const html = readFileSync(htmlPath, 'utf-8');
|
||||
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
||||
res.status(200).send(html);
|
||||
} catch (fallbackError) {
|
||||
} catch {
|
||||
res.status(500).send('Internal Server Error');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user