Add LICENSE, README, and Docs tab to Mission Control

This commit is contained in:
root
2026-02-22 07:33:18 +00:00
parent 3e7b457d5f
commit 0817444dc5
68 changed files with 6677 additions and 1673 deletions
+39
View File
@@ -0,0 +1,39 @@
import { NextRequest, NextResponse } from 'next/server'
import * as fs from 'fs'
import * as path from 'path'
const dataFile = path.join(process.cwd(), 'trading-trades.json')
export async function GET() {
try {
let trades = []
if (fs.existsSync(dataFile)) {
trades = JSON.parse(fs.readFileSync(dataFile, 'utf-8'))
}
return NextResponse.json({ trades })
} catch (error) {
return NextResponse.json({ trades: [] })
}
}
export async function POST(request: NextRequest) {
try {
const body = await request.json()
let trades = []
if (fs.existsSync(dataFile)) {
trades = JSON.parse(fs.readFileSync(dataFile, 'utf-8'))
}
trades.push({
...body,
id: Date.now().toString(),
openedAt: new Date().toISOString()
})
fs.writeFileSync(dataFile, JSON.stringify(trades, null, 2))
return NextResponse.json({ success: true })
} catch (error) {
return NextResponse.json({ error: 'Failed to save' }, { status: 500 })
}
}