Added carrousell integration
This commit is contained in:
parent
952bc13f68
commit
3d8158e786
4
index.js
4
index.js
@ -787,16 +787,16 @@ const storage = multer.diskStorage({
|
|||||||
|
|
||||||
const upload = multer({ storage });
|
const upload = multer({ storage });
|
||||||
|
|
||||||
router.post("/api/teams/:id/carousel-upload", upload.single("image"), (req, res) => {
|
app.post("/api/teams/:id/carousel-upload", upload.single("image"), (req, res) => {
|
||||||
if (!req.file) return res.status(400).json({ error: "Keine Datei hochgeladen" });
|
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}`;
|
const filePath = `/uploads/carousel/${req.file.filename}`;
|
||||||
res.json({ path: filePath });
|
res.json({ path: filePath });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Server starten
|
// Server starten
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
const nets = os.networkInterfaces();
|
const nets = os.networkInterfaces();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user