removing server routes that are unused
This commit is contained in:
@@ -1,36 +0,0 @@
|
|||||||
import { NextResponse } from 'next/server';
|
|
||||||
|
|
||||||
export const runtime = 'edge';
|
|
||||||
|
|
||||||
export async function GET() {
|
|
||||||
try {
|
|
||||||
const response = await fetch(
|
|
||||||
'https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd',
|
|
||||||
{
|
|
||||||
headers: {
|
|
||||||
'Accept': 'application/json',
|
|
||||||
},
|
|
||||||
cache: 'no-store',
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
console.error(`CoinGecko API error: ${response.status} ${response.statusText}`);
|
|
||||||
throw new Error(`CoinGecko API error: ${response.statusText}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
return NextResponse.json(data, {
|
|
||||||
headers: {
|
|
||||||
'Cache-Control': 'public, s-maxage=60, stale-while-revalidate=120',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error fetching gas price:', error);
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: 'Failed to fetch gas price', details: error instanceof Error ? error.message : 'Unknown error' },
|
|
||||||
{ status: 500 }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user