'Why my Express Static Folder aren't Working Properly
why my static folder isn't working if I use Cloudinary and express-fileupload for profile IMG (client-side) upload and multer for post cover image upload only one of them are working if comment out the other one please help me to get rid of this problem...
const express = require("express");
const cors = require('cors');
const fileUpload = require('express-fileupload');
const app = express();
app.use(cors());
// Below code is for client side profile photo upload it is stores in cloudinary
app.use(fileUpload({
useTempFiles: true
}));
// Below code is static post cover photo it is stores in static folder in backend
app.use('/', express.static('uploads'));
app.get("/", (req, res, next) => {
res.send("Api running");
});
// Connecting Routes
app.use('/', require('./routes/indexpost'));
app.use('/user', require('./routes/userRouter'));
app.use('/api', require('./routes/upload'));
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
