mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 07:43:16 +10:00
32 lines
690 B
TypeScript
32 lines
690 B
TypeScript
import cors from '@/lib/cors';
|
|
import { transformData } from '@/lib/transform-data';
|
|
|
|
export async function GET(request: Request) {
|
|
const res = await fetch('https://stargrazer-live.onrender.com/api/stats/stripe');
|
|
const EARLY_ADOPTERS_DATA = await res.json();
|
|
|
|
const transformedData = transformData({
|
|
data: EARLY_ADOPTERS_DATA,
|
|
metric: 'earlyAdopters',
|
|
});
|
|
|
|
return cors(
|
|
request,
|
|
new Response(JSON.stringify(transformedData), {
|
|
status: 200,
|
|
headers: {
|
|
'content-type': 'application/json',
|
|
},
|
|
}),
|
|
);
|
|
}
|
|
|
|
export function OPTIONS(request: Request) {
|
|
return cors(
|
|
request,
|
|
new Response(null, {
|
|
status: 204,
|
|
}),
|
|
);
|
|
}
|