fix(proxy): Bind express to 0.0.0.0 and update healthcheck
This commit is contained in:
parent
10f772942a
commit
44f88ff04b
|
|
@ -63,12 +63,12 @@ function authMiddleware(req, res, next) {
|
|||
next();
|
||||
}
|
||||
|
||||
// Global middleware: Auth first (skip /health), then body parser
|
||||
// Global middleware: Body parser first, then auth (skip /health)
|
||||
app.use(bodyParser.json({ limit: '10mb' }));
|
||||
app.use((req, res, next) => {
|
||||
if (req.path === '/health') return next();
|
||||
authMiddleware(req, res, next);
|
||||
});
|
||||
app.use(bodyParser.json({ limit: '10mb' }));
|
||||
|
||||
// Gemini Client with JSON response configuration
|
||||
const genAI = new GoogleGenerativeAI(API_KEY);
|
||||
|
|
@ -224,7 +224,7 @@ app.get('/health', (req, res) => {
|
|||
});
|
||||
|
||||
// Start Server
|
||||
app.listen(PORT, () => {
|
||||
app.listen(PORT, '0.0.0.0', () => {
|
||||
console.log(`Proxy Server running on port ${PORT}`);
|
||||
if (!API_KEY) console.error('WARNING: GEMINI_API_KEY is not set!');
|
||||
if (!AUTH_TOKEN) console.error('WARNING: PROXY_AUTH_TOKEN is not set! Authentication is disabled.');
|
||||
|
|
|
|||
Loading…
Reference in New Issue