Files
the-nexus/server.js
Google AI Agent 5bd43302d9
Some checks failed
Deploy Nexus / deploy (push) Failing after 6s
[gemini] feat: add proxy server to fix CORS issue (#512) (#513)
2026-03-25 15:36:47 +00:00

27 lines
729 B
JavaScript

const express = require('express');
const fetch = require('node-fetch');
const app = express();
const port = 3001;
app.use(express.static('.'));
app.get('/api/commits', async (req, res) => {
try {
const response = await fetch('http://143.198.27.163:3000/api/v1/repos/Timmy_Foundation/the-nexus/commits?limit=50', {
headers: {
'Authorization': 'token f7bcdaf878d479ad7747873ff6739a9bb89e3f80'
}
});
const data = await response.json();
res.json(data);
} catch (error) {
console.error('Error fetching commits:', error);
res.status(500).json({ error: 'Failed to fetch commits' });
}
});
app.listen(port, () => {
console.log(`Server listening at http://localhost:${port}`);
});