Added carrousell integration
This commit is contained in:
parent
3c8659fbfc
commit
952bc13f68
23
index.js
23
index.js
@ -771,6 +771,29 @@ app.post("/api/players/:id/assign-team", async (req, res) => {
|
||||
});
|
||||
|
||||
|
||||
//Carousell Bilder für Teams hochladen
|
||||
const multer = require("multer");
|
||||
const path = require("path");
|
||||
|
||||
const storage = multer.diskStorage({
|
||||
destination: function (req, file, cb) {
|
||||
cb(null, "uploads/carousel");
|
||||
},
|
||||
filename: function (req, file, cb) {
|
||||
const uniqueName = Date.now() + "-" + file.originalname;
|
||||
cb(null, uniqueName);
|
||||
},
|
||||
});
|
||||
|
||||
const upload = multer({ storage });
|
||||
|
||||
router.post("/api/teams/:id/carousel-upload", upload.single("image"), (req, res) => {
|
||||
if (!req.file) return res.status(400).json({ error: "Keine Datei hochgeladen" });
|
||||
|
||||
// z. B. /uploads/carousel/171654543-name.jpg
|
||||
const filePath = `/uploads/carousel/${req.file.filename}`;
|
||||
res.json({ path: filePath });
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
17
node_modules/.bin/bcrypt
generated
vendored
17
node_modules/.bin/bcrypt
generated
vendored
@ -1 +1,16 @@
|
||||
../bcryptjs/bin/bcrypt
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../bcryptjs/bin/bcrypt" "$@"
|
||||
else
|
||||
exec node "$basedir/../bcryptjs/bin/bcrypt" "$@"
|
||||
fi
|
||||
|
||||
17
node_modules/.bin/mkdirp
generated
vendored
17
node_modules/.bin/mkdirp
generated
vendored
@ -1 +1,16 @@
|
||||
../mkdirp/bin/cmd.js
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../mkdirp/bin/cmd.js" "$@"
|
||||
fi
|
||||
|
||||
17
node_modules/.bin/semver
generated
vendored
17
node_modules/.bin/semver
generated
vendored
@ -1 +1,16 @@
|
||||
../semver/bin/semver.js
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../semver/bin/semver.js" "$@"
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user