come on ai get it right
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m14s

This commit is contained in:
2025-12-01 21:40:09 -08:00
parent 3ebb025ed0
commit 337b3272ee

View File

@@ -33,7 +33,7 @@ const uploadToMemory = multer({ storage: memoryStorage });
* This endpoint processes a flyer using AI. It uses `optionalAuth` middleware to allow
* both authenticated and anonymous users to upload flyers.
*/
router.post('/process-flyer', optionalAuth, uploadToMemory.array('flyerImages'), async (req: Request, res: Response, next: NextFunction) => {
router.post('/process-flyer', optionalAuth, uploadToDisk.array('flyerImages'), async (req: Request, res: Response, next: NextFunction) => {
try {
const files = req.files as Express.Multer.File[];
const totalSize = files ? files.reduce((acc, file) => acc + file.size, 0) : 0;
@@ -137,7 +137,7 @@ router.post('/flyers/process', optionalAuth, uploadToDisk.single('flyerImage'),
* This endpoint checks if an image is a flyer. It uses `optionalAuth` to allow
* both authenticated and anonymous users to perform this check.
*/
router.post('/check-flyer', optionalAuth, uploadToMemory.single('image'), async (req, res, next) => {
router.post('/check-flyer', optionalAuth, uploadToDisk.single('image'), async (req, res, next) => {
try {
if (!req.file) {
return res.status(400).json({ message: 'Image file is required.' });
@@ -149,7 +149,7 @@ router.post('/check-flyer', optionalAuth, uploadToMemory.single('image'), async
}
});
router.post('/extract-address', optionalAuth, uploadToMemory.single('image'), async (req, res, next) => {
router.post('/extract-address', optionalAuth, uploadToDisk.single('image'), async (req, res, next) => {
try {
if (!req.file) {
return res.status(400).json({ message: 'Image file is required.' });
@@ -161,7 +161,7 @@ router.post('/extract-address', optionalAuth, uploadToMemory.single('image'), as
}
});
router.post('/extract-logo', optionalAuth, uploadToMemory.array('images'), async (req, res, next) => {
router.post('/extract-logo', optionalAuth, uploadToDisk.array('images'), async (req, res, next) => {
try {
if (!req.files || !Array.isArray(req.files) || req.files.length === 0) {
return res.status(400).json({ message: 'Image files are required.' });
@@ -235,7 +235,7 @@ router.post('/generate-speech', passport.authenticate('jwt', { session: false })
router.post(
'/rescan-area',
passport.authenticate('jwt', { session: false }),
uploadToMemory.single('image'),
uploadToDisk.single('image'),
async (req: Request, res: Response, next: NextFunction) => {
try {
if (!req.file) {