import { Router } from 'express';
import multer from 'multer';
import { requireAuth } from '../middleware/auth';
import { uploadDocument, registerLocalDocument } from '../controllers/document.controller';

const router = Router();
const upload = multer({ storage: multer.memoryStorage() });

router.post('/upload', upload.single('file'), requireAuth, uploadDocument);
router.post('/register-local', requireAuth, registerLocalDocument);

export default router;
