Skip to content

Commit 4f6190b

Browse files
Merge pull request #35 from ARIHANTJAIN2006/pr
User-Information-update endpoints creation
2 parents 6a0f76b + cd6a400 commit 4f6190b

File tree

89 files changed

+16385
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+16385
-11
lines changed

backend/package-lock.json

Lines changed: 217 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@
2323
"express": "^5.2.1",
2424
"jsonwebtoken": "^9.0.3",
2525
"mongoose": "^8.8.4",
26+
"multer": "^2.0.2",
2627
"zod": "^4.3.5"
2728
},
2829
"devDependencies": {
30+
"@types/bcrypt": "^6.0.0",
2931
"@types/bcryptjs": "^3.0.0",
3032
"@types/cors": "^2.8.17",
3133
"@types/express": "^5.0.6",
3234
"@types/jsonwebtoken": "^9.0.10",
35+
"@types/multer": "^2.0.0",
3336
"@types/node": "^25.0.3",
3437
"nodemon": "^3.1.11",
3538
"ts-node": "^10.9.2",

backend/src/config/cloudinary.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import cloudinaryModule from "cloudinary";
2+
const cloudinary = cloudinaryModule.v2;
3+
4+
cloudinary.config({
5+
cloud_name: process.env.CLOUDINARY_CLOUD_NAME!,
6+
api_key: process.env.CLOUDINARY_API_KEY!,
7+
api_secret: process.env.CLOUDINARY_API_SECRET!,
8+
secure: true,
9+
});
10+
11+
export default cloudinary;

backend/src/config/multer.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import multer from 'multer';
2+
import path from 'path';
3+
import fs from 'fs';
4+
5+
const storage = multer.diskStorage({
6+
destination: (req, file, cb) => {
7+
const dir = path.join(__dirname, "../../uploadstemp");
8+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
9+
cb(null, dir);
10+
},
11+
filename: (req, file, cb) => {
12+
cb(null, Date.now() + path.extname(file.originalname));
13+
}
14+
});
15+
16+
const upload = multer({ storage });
17+
export default upload;

0 commit comments

Comments
 (0)