Seokjin

[UPDATE]filelocation

......@@ -17,7 +17,7 @@ let db = mongoose.connect(uri, (err) => {
console.log('Succesfully Connected!');
}
});
console.log(__dirname);
var clothesSchema = new mongoose.Schema({
gender: Number,
weather: Number,
......@@ -56,7 +56,7 @@ app.post('/api/clothes', (req, res) => {
let randb=Math.floor(Math.random()*clothes.bottom.length);
if (err) return res.status(500).json({ MatchingSuccess: false });
else if (clothes) {
return res.status(200).json({top:clothes.top[randt],bottom:clothes.bottom[randb]});
return res.status(200).json({top:"../../../../src/img/"+ clothes.top[randt]+".jpg",bottom:"../../../../src/img/"+ clothes.bottom[randb]+".jpg"});
}
else return res.status(404).json({ MatchingSuccess: false });
});
......