refactor: use real api.riotpiao.com in both dev and production
Build & Push Portfolio Image / build-push (push) Successful in 31s

This commit is contained in:
Story Crater Bot
2026-09-01 10:31:07 -07:00
parent 8cad006334
commit 989109352b
+1 -40
View File
@@ -35,9 +35,8 @@ Pre-screen context: Technical depth for platform engineer role. Cert rotation, q
export async function POST(request: NextRequest) {
const token = process.env.LLM_API_TOKEN
const isDev = process.env.NODE_ENV === 'development'
if (!token && !isDev) {
if (!token) {
return new Response(
JSON.stringify({ error: 'LLM_API_TOKEN not configured' }),
{ status: 500, headers: { 'Content-Type': 'application/json' } }
@@ -47,44 +46,6 @@ export async function POST(request: NextRequest) {
try {
const { message } = await request.json()
// Dev fallback: mock streaming response
if (isDev && !token) {
const encoder = new TextEncoder()
const mockReasoning = `Analyzing "${message}"...`
const mockContent = `Rock has 6+ years experience in Infrastructure, Backend, and LLM Systems. His expertise spans Kubernetes, Terraform, vLLM optimization (60% latency cut), AWS Distributed-Map across 57+ regions, and production homelab with 99.2% uptime.`
const stream = new ReadableStream({
async start(controller) {
let reasoning = ''
let content = ''
// Stream reasoning
for (const char of mockReasoning) {
reasoning += char
controller.enqueue(encoder.encode(`data: ${JSON.stringify({ type: 'reasoning', text: reasoning })}\n\n`))
await new Promise(r => setTimeout(r, 5))
}
// Stream content
for (const char of mockContent) {
content += char
controller.enqueue(encoder.encode(`data: ${JSON.stringify({ type: 'content', text: content })}\n\n`))
await new Promise(r => setTimeout(r, 10))
}
controller.enqueue(encoder.encode(`data: ${JSON.stringify({ type: 'done' })}\n\n`))
controller.close()
},
})
return new Response(stream, {
headers: {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
},
})
}
const response = await fetch(LLM_API_URL, {
method: 'POST',
headers: {