come on ai get it right
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m14s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 4m14s
This commit is contained in:
@@ -33,7 +33,7 @@ const uploadToMemory = multer({ storage: memoryStorage });
|
|||||||
* This endpoint processes a flyer using AI. It uses `optionalAuth` middleware to allow
|
* This endpoint processes a flyer using AI. It uses `optionalAuth` middleware to allow
|
||||||
* both authenticated and anonymous users to upload flyers.
|
* 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 {
|
try {
|
||||||
const files = req.files as Express.Multer.File[];
|
const files = req.files as Express.Multer.File[];
|
||||||
const totalSize = files ? files.reduce((acc, file) => acc + file.size, 0) : 0;
|
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
|
* This endpoint checks if an image is a flyer. It uses `optionalAuth` to allow
|
||||||
* both authenticated and anonymous users to perform this check.
|
* 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 {
|
try {
|
||||||
if (!req.file) {
|
if (!req.file) {
|
||||||
return res.status(400).json({ message: 'Image file is required.' });
|
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 {
|
try {
|
||||||
if (!req.file) {
|
if (!req.file) {
|
||||||
return res.status(400).json({ message: 'Image file is required.' });
|
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 {
|
try {
|
||||||
if (!req.files || !Array.isArray(req.files) || req.files.length === 0) {
|
if (!req.files || !Array.isArray(req.files) || req.files.length === 0) {
|
||||||
return res.status(400).json({ message: 'Image files are required.' });
|
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(
|
router.post(
|
||||||
'/rescan-area',
|
'/rescan-area',
|
||||||
passport.authenticate('jwt', { session: false }),
|
passport.authenticate('jwt', { session: false }),
|
||||||
uploadToMemory.single('image'),
|
uploadToDisk.single('image'),
|
||||||
async (req: Request, res: Response, next: NextFunction) => {
|
async (req: Request, res: Response, next: NextFunction) => {
|
||||||
try {
|
try {
|
||||||
if (!req.file) {
|
if (!req.file) {
|
||||||
|
|||||||
Reference in New Issue
Block a user