fix: resolve mixed content and upload payload too large errors
Build and Deploy / build-and-push (push) Failing after 26s
Build and Deploy / build-and-push (push) Failing after 26s
This commit is contained in:
+1
-1
@@ -212,7 +212,7 @@ app.post('/api/users/deduct-credit', authenticate, async (req, res) => {
|
||||
// 10. Upload file
|
||||
app.post('/api/upload', authenticate, upload.single('file'), (req, res) => {
|
||||
if (!req.file) return res.status(400).json({ error: 'No file uploaded' });
|
||||
const url = `${req.protocol}://${req.get('host')}/uploads/${req.file.filename}`;
|
||||
const url = `/uploads/${req.file.filename}`;
|
||||
res.json({ url });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user