diff --git a/.gitignore b/.gitignore index 5a044c6ca5f127f517acc19ae1d82bd0f8a97f29..c2f87a63906136b2a1c3a632614a09cff159bdc4 100644 --- a/.gitignore +++ b/.gitignore @@ -82,4 +82,4 @@ typings/ build/ # Mongose database -data/ \ No newline at end of file +data/ diff --git a/README.md b/README.md index 4e413363e7908351e704158ccc1881f4c9e8c10a..92c0858e9733c920eb233c1d81ad570d609f3e46 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Schönherz BodyKör webpage backend +## Initial Setup + +uploads/card_images and uploads/profile_pictures folder +needed for file uploads! + ## Recommended Extensions VSCode: diff --git a/src/middlewares/files/profilePictureStorage.ts b/src/middlewares/files/profilePictureStorage.ts index 5f484bcc3cbcc714b25cd86c1edbdd69931c4ad6..2252de35e4c93ed3fe44f95a8365df6e0ec7c5ac 100644 --- a/src/middlewares/files/profilePictureStorage.ts +++ b/src/middlewares/files/profilePictureStorage.ts @@ -3,7 +3,7 @@ import path from "path"; export const profilePictureStorage = multer.diskStorage({ destination: function (req, file, callback) { - callback(null, "uploads/profile_picture/"); + callback(null, "uploads/profile_pictures/"); }, filename: function (req, file, callback) { callback(null, Date.now() + "-" + file.originalname); diff --git a/uploads/.gitignore b/uploads/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b47774fb78499b79f7623ef1d38cc21ece9da0e5 --- /dev/null +++ b/uploads/.gitignore @@ -0,0 +1,4 @@ +/* +!/card_images/ +!/profile_pictures/ +!/.gitignore \ No newline at end of file diff --git a/uploads/card_images/.gitignore b/uploads/card_images/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..11b4bb12f5316d10b506a44104228630cf92a52f --- /dev/null +++ b/uploads/card_images/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore \ No newline at end of file diff --git a/uploads/profile_picture/.gitkeep b/uploads/profile_picture/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/uploads/profile_pictures/.gitignore b/uploads/profile_pictures/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..11b4bb12f5316d10b506a44104228630cf92a52f --- /dev/null +++ b/uploads/profile_pictures/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore \ No newline at end of file