cleanup
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
// src/pages/api/debug-env.ts
|
||||
import type { APIRoute } from 'astro';
|
||||
import { debugEmbeddings } from '../../utils/embeddings.js';
|
||||
|
||||
export const GET: APIRoute = async () => {
|
||||
const embeddingVars = Object.keys(process.env)
|
||||
.filter(key => key.includes('EMBEDDINGS'))
|
||||
.reduce((obj: Record<string, string>, key) => {
|
||||
obj[key] = process.env[key] || 'undefined';
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
const aiVars = Object.keys(process.env)
|
||||
.filter(key => key.includes('AI_'))
|
||||
.reduce((obj: Record<string, string>, key) => {
|
||||
// Mask sensitive values
|
||||
const value = process.env[key] || 'undefined';
|
||||
obj[key] = key.includes('KEY') || key.includes('SECRET') ?
|
||||
(value.length > 10 ? `${value.slice(0, 6)}...${value.slice(-4)}` : value) :
|
||||
value;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
// Force recheck embeddings environment
|
||||
await debugEmbeddings.recheckEnvironment();
|
||||
const embeddingsStatus = debugEmbeddings.getStatus();
|
||||
|
||||
return new Response(JSON.stringify({
|
||||
timestamp: new Date().toISOString(),
|
||||
embeddingVars,
|
||||
allAiVars: aiVars,
|
||||
totalEnvVars: Object.keys(process.env).length,
|
||||
embeddingsStatus,
|
||||
nodeEnv: process.env.NODE_ENV,
|
||||
platform: process.platform
|
||||
}, null, 2), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user