const express = require('express');
const { createProxyMiddleware } = require('http-proxy-middleware');
const path = require('path');

const app = express();
const PORT = 8080;

app.use('/api', createProxyMiddleware({
  target: 'https://cattletrack.aiotagro.com',
  changeOrigin: true,
  secure: false,
}));

app.use(express.static(path.join(__dirname, 'datav')));

app.listen(PORT, () => console.log(`http://127.0.0.1:8081`));