delete: server.js — does not serve heartbeat/harness/portal (#548)
Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
This commit is contained in:
26
server.js
26
server.js
@@ -1,26 +0,0 @@
|
|||||||
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}`);
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user