ocr 및 스캐너 기능 구현

This commit is contained in:
ysj7705 committed 2026-07-22 11:48:48 +09:00
1 parent 1dbc73312b
commit 2c64369694
24 files changed
+3556 -8

No files matched your search

+12 -1
View File
@@ -40,12 +40,23 @@ async function main() {
app.use('/api/documents', documentsRouter);
if (fs.existsSync(config.publicDir)) {
app.use(express.static(config.publicDir));
app.use(express.static(config.publicDir, {
setHeaders(res, filePath) {
if (filePath.endsWith('.wasm')) {
res.setHeader('Content-Type', 'application/wasm');
}
},
}));
app.get('*', (req, res, next) => {
if (req.path.startsWith('/api')) {
next();
return;
}
// Do not SPA-fallback missing static assets (wasm, workers, traineddata).
if (/\.[a-z0-9]+$/i.test(req.path)) {
res.status(404).end();
return;
}
res.sendFile(path.join(config.publicDir, 'index.html'));
});
}