update
This commit is contained in:
@@ -51,7 +51,54 @@ app.post('/api/unsubscribe', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Frontend server running on http://localhost:${PORT}`);
|
||||
// Ollama API proxy endpoints for admin dashboard
|
||||
app.get('/api/ollama/ping', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/api/ollama/ping`);
|
||||
res.json(response.data);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: 'Failed to ping Ollama' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/ollama/gpu-status', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/api/ollama/gpu-status`);
|
||||
res.json(response.data);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: 'Failed to get GPU status' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/ollama/test', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/api/ollama/test`);
|
||||
res.json(response.data);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: 'Failed to test Ollama' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/ollama/models', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/api/ollama/models`);
|
||||
res.json(response.data);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: 'Failed to get models' });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/ollama/config', async (req, res) => {
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/api/ollama/config`);
|
||||
res.json(response.data);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: 'Failed to get config' });
|
||||
}
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Frontend server running on http://localhost:${PORT}`);
|
||||
console.log(`Admin dashboard: http://localhost:${PORT}/admin.html`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user