feat: creates backend for the project

This commit is contained in:
vakabunga
2026-03-02 00:32:37 +03:00
parent 9d12702688
commit 4d67636633
24 changed files with 1735 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { Router } from 'express';
import { asyncHandler } from '../utils';
import { importStatement, isValidationError } from '../services/import';
const router = Router();
router.post(
'/statement',
asyncHandler(async (req, res) => {
const result = await importStatement(req.body);
if (isValidationError(result)) {
res.status((result as { status: number }).status).json({
error: (result as { error: string }).error,
message: (result as { message: string }).message,
});
return;
}
res.json(result);
}),
);
export default router;