Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/src/app/api/candles/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { NextRequest } from 'next/server';
import { authenticate, unauthorized } from '@/lib/api-auth';

interface Bar {
time: number;
Expand Down Expand Up @@ -136,6 +137,9 @@ async function fromGemini(pair: string, timeframe: string, limit: number): Promi
}

export async function GET(req: NextRequest) {
const auth = await authenticate(req);
if (!auth) return unauthorized();

const { searchParams } = new URL(req.url);
const pair = (searchParams.get('pair') ?? '').toUpperCase();
const exchange = (searchParams.get('exchange') ?? '').toLowerCase();
Expand Down
Loading