Skip to content

Commit a02f5d6

Browse files
committed
fix
1 parent 18eba15 commit a02f5d6

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

server/api-proxy.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ router.get('/github/rich-address-wallet/:endpoint', async (req, res) => {
2222
}
2323

2424
// Make the actual request to GitHub API
25-
const response = await axios.get(`https://api.github.com/repos/Pymmdrza/Rich-Address-Wallet/releases/${endpoint}`, {
25+
const response = await axios.get(`https://api.github.com/repos/Pymmdrza/Rich-Address-Wallet/${endpoint}`, {
2626
headers: {
2727
'Accept': 'application/json',
2828
'User-Agent': 'BlockHub-App/1.0'
@@ -59,8 +59,7 @@ router.get('/proxy', async (req, res) => {
5959
'api.github.com',
6060
'api.coingecko.com',
6161
'blockchain.info',
62-
'ws.blockvhain.info',
63-
'btcbook.guarda.co'
62+
'bitcoin.atomicwallet.io'
6463
];
6564

6665
const url = new URL(endpoint);
@@ -89,4 +88,4 @@ router.get('/proxy', async (req, res) => {
8988
}
9089
});
9190

92-
module.exports = router;
91+
module.exports = router;

server/index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ app.get('/api/github/rich-address-wallet/:endpoint', async (req, res) => {
4646
}
4747

4848
// Make the actual request to GitHub API
49-
const response = await axios.get(`https://api.github.com/repos/Pymmdrza/Rich-Address-Wallet/releases/${endpoint}`, {
49+
const response = await axios.get(`https://api.github.com/repos/Pymmdrza/Rich-Address-Wallet/${endpoint}`, {
5050
headers: {
5151
'Accept': 'application/json',
5252
'User-Agent': 'BlockHub-App/1.0'
@@ -77,12 +77,12 @@ app.get('/health/status', (req, res) => {
7777
// Setup API proxies
7878
// Bitcoin API proxy
7979
app.use('/api/v2', createProxyMiddleware({
80-
target: 'https://btcbook.guarda.co',
80+
target: 'https://bitcoin.atomicwallet.io',
8181
changeOrigin: true,
8282
pathRewrite: { '^/api/v2': '/api/v2' },
8383
headers: {
8484
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
85-
'Referer': 'https://guarda.co/'
85+
'Referer': 'https://atomicwallet.io/'
8686
},
8787
onProxyReq: (proxyReq) => {
8888
proxyReq.setHeader('Accept', 'application/json');
@@ -131,8 +131,7 @@ app.get('/api/proxy', async (req, res) => {
131131
const allowedDomains = [
132132
'api.github.com',
133133
'blockchain.info',
134-
'ws.blockchain.info',
135-
'btcbook.guarda.co'
134+
'bitcoin.atomicwallet.io'
136135
];
137136

138137
const url = new URL(endpoint);
@@ -197,15 +196,14 @@ app.use((req, res, next) => {
197196
next();
198197
});
199198

200-
// Handle client-side routing
199+
// For any request that doesn't match the above, send the index.html file
201200
app.get('*', (req, res) => {
202201
res.sendFile(path.join(__dirname, '../dist/index.html'));
203202
});
204203

205204
// Start the server
206205
app.listen(PORT, () => {
207206
console.log(`Server running on port ${PORT}`);
208-
console.log(`Server Domain Address : ${process.env.DOMAIN || 'localhost'}`)
209207
console.log(`Environment: ${process.env.NODE_ENV || 'development'}`);
210208
logStream.write(`[${new Date().toISOString()}] Server started on port ${PORT}\n`);
211209
});
@@ -225,4 +223,4 @@ process.on('uncaughtException', (err) => {
225223
console.error('Uncaught exception:', err);
226224
logStream.write(`[${new Date().toISOString()}] Uncaught exception: ${err.message}\n${err.stack}\n`);
227225
process.exit(1);
228-
});
226+
});

0 commit comments

Comments
 (0)