Hola tengo un problema compilar estas lineas de codigo:
module.exports = {
Image = require('./image.js')
};
Error Invalid shorthand property initializer
Esto va unido con lo otro pero en distintos archivos const path = require('path'); const {randomNumber} = require('../helpers/libs');
const fs = require('fs-extra');
const { Image } = require('../models');
const ctrl = {};
ctrl.index = (req, res) => {
};
ctrl.create = async (req, res) => {
const imgUrl = randomNumber();
console.log(imgUrl);
const imageTempPath = req.file.path;
const ext = path.extname(req.file.originalname).toLowerCase();
const targetPath = path.resolve(`src/public/upload/${imgUrl}${ext}`);
if(ext === ".png" || ext === ".jpg" || ext === ".jpeg" || ext === ".gif" || ext === ".svg" || ext === ".tiff" || ext === ".tif") {
await fs.rename(imageTempPath, targetPath);
const newImg = new Image({
title: req.body.title,
description: req.body.description,
filename: imgUrl + ext
});
console.log(newImg);
}
res.send("Recibido");
};
ctrl.like = (req, res) => {
};
ctrl.comment = (req, res) => {
};
ctrl.remove = (req, res) => {
};
module.exports = ctrl;
me seria de mucha ayuda que me ayudaran porfavor
const Image = require('./image.js'); module.exports = Image