|
import { Router } from 'express'; |
|
|
|
const router = Router(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
router.post('/upload', async (req, res) => { |
|
res.status(503).json({ |
|
success: false, |
|
error: 'File uploads disabled', |
|
message: 'File uploads are currently disabled in this environment. This is typically the case in demo environments or spaces without persistent storage.', |
|
suggestion: 'You can still use the search functionality with external sources, or deploy the application with persistent storage to enable document uploads.' |
|
}); |
|
}); |
|
|
|
router.post('/process/:id', async (req, res) => { |
|
res.status(503).json({ |
|
success: false, |
|
error: 'Document processing disabled', |
|
message: 'Document processing is disabled when file uploads are not available.' |
|
}); |
|
}); |
|
|
|
router.post('/process/batch', async (req, res) => { |
|
res.status(503).json({ |
|
success: false, |
|
error: 'Batch processing disabled', |
|
message: 'Batch processing is disabled when file uploads are not available.' |
|
}); |
|
}); |
|
|
|
router.post('/index/build', async (req, res) => { |
|
res.status(503).json({ |
|
success: false, |
|
error: 'Index building disabled', |
|
message: 'Vector index building is disabled when document uploads are not available.' |
|
}); |
|
}); |
|
|
|
router.post('/search/vector', async (req, res) => { |
|
res.status(503).json({ |
|
success: false, |
|
error: 'Vector search disabled', |
|
message: 'Vector search is disabled when no documents have been uploaded and processed.' |
|
}); |
|
}); |
|
|
|
router.get('/list', async (req, res) => { |
|
res.json({ |
|
success: true, |
|
documents: [], |
|
totalCount: 0, |
|
message: 'No documents available - file uploads are disabled in this environment' |
|
}); |
|
}); |
|
|
|
router.get('/status/:id', async (req, res) => { |
|
res.status(404).json({ |
|
success: false, |
|
error: 'Document not found', |
|
message: 'Document processing is disabled in this environment' |
|
}); |
|
}); |
|
|
|
router.delete('/:id', async (req, res) => { |
|
res.status(503).json({ |
|
success: false, |
|
error: 'Document deletion disabled', |
|
message: 'Document operations are disabled when file uploads are not available.' |
|
}); |
|
}); |
|
|
|
export default router; |