const express = require('express');
const router = express.Router();
const cors = require('cors');
const projectRoutes = require('./routes/projectRoutes');
const measurementRoutes = require('./routes/measurementRoutes');
const videoRoutes = require('./routes/videoRoutes');
const imageRoutes = require('./routes/imageRoutes');
const cameraRoutes = require('./routes/cameraRoutes');
const uploadRoutes = require('./routes/uploadRoutes');
const fileWatcher = require('./src/data/filewatcher.js');
const ffmpeg = require('./ffmpeg.js');

router.use(cors({
  origin: ['http://127.0.0.1:5500', 'http://localhost:5500', 'http://localhost:3000'],
  methods: ['GET', 'POST', 'PUT', 'DELETE'],
  allowedHeaders: ['Content-Type'],
  credentials: true,
}));

router.use('/', projectRoutes);
router.use('/', measurementRoutes);
router.use('/', videoRoutes);
router.use('/', imageRoutes);
router.use('/', uploadRoutes);
router.use('/', cameraRoutes);

module.exports = router;
