- Add settings manager to persist symbol, timeframe, and layouts - Support multiple layouts for comprehensive chart analysis - Remove debug screenshots for cleaner logs - Update AI analysis with professional trading prompt - Add multi-screenshot analysis for better trading insights - Update analyze API to use saved settings and multiple layouts
23 lines
651 B
TypeScript
23 lines
651 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
import fs from 'fs/promises'
|
|
import path from 'path'
|
|
|
|
export async function GET(
|
|
request: NextRequest,
|
|
context: any
|
|
) {
|
|
try {
|
|
const screenshotsDir = path.join(process.cwd(), 'screenshots')
|
|
const filePath = path.join(screenshotsDir, context.params.filename)
|
|
const file = await fs.readFile(filePath)
|
|
return new NextResponse(file, {
|
|
headers: {
|
|
'Content-Type': 'image/png',
|
|
'Content-Disposition': `inline; filename="${context.params.filename}"`
|
|
}
|
|
})
|
|
} catch (e: any) {
|
|
return NextResponse.json({ error: e.message }, { status: 404 })
|
|
}
|
|
}
|