Spaces:
Paused
Paused
File size: 659 Bytes
c05f257 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | const express = require('express');
const { createProxyMiddleware } = require('http-proxy-middleware');
const path = require('path');
const app = express();
const port = 7860;
const targetUrl = 'http://91.107.248.81:8080';
app.use(express.static(path.join(__dirname, 'public')));
app.use('/api/v1/sync', createProxyMiddleware({
target: targetUrl,
changeOrigin: true,
ws: true,
logLevel: 'silent',
onError: (err, req, res) => {
res.status(500).json({ error: "Internal Service Error" });
}
}));
app.get('/health', (req, res) => {
res.status(200).json({ status: "active", version: "1.0.2" });
});
app.listen(port); |