* docs: change configurations to make v2 the main docs * move api routes to top level * remove api prefix * update opengraph images * show v1 link * add redirect to v1
21 lines
470 B
TypeScript
21 lines
470 B
TypeScript
"use server"
|
|
|
|
import { Area, ExpandedDocument } from "../types/openapi"
|
|
|
|
const URL = `${process.env.NEXT_PUBLIC_BASE_URL}${process.env.NEXT_PUBLIC_BASE_PATH}`
|
|
|
|
export async function getBaseSpecs(area: Area) {
|
|
try {
|
|
const res = await fetch(`${URL}/base-specs?area=${area}`, {
|
|
next: {
|
|
revalidate: 3000,
|
|
tags: [area],
|
|
},
|
|
}).then(async (res) => res.json())
|
|
|
|
return res as ExpandedDocument
|
|
} catch (e) {
|
|
console.error(e)
|
|
}
|
|
}
|