fix(website): pass on revalidate

This commit is contained in:
iCrawl 2023-04-09 18:55:59 +02:00
parent d1955f7c9e
commit 7d3827ebd1
No known key found for this signature in database
GPG key ID: 1AB888B16355FBB2

View file

@ -4,7 +4,12 @@ import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import { connect } from '@planetscale/database';
const sql = connect({ url: process.env.DATABASE_URL! });
const sql = connect({
async fetch(input, init) {
return fetch(input, { ...init, next: { revalidate: 3_600 } });
},
url: process.env.DATABASE_URL!,
});
export async function fetchVersions(packageName: string): Promise<string[]> {
const response = await fetch(`https://docs.discordjs.dev/api/info?package=${packageName}`, {