Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -17,7 +17,7 @@ let db = mongoose.connect(uri, (err) => { | ... | @@ -17,7 +17,7 @@ let db = mongoose.connect(uri, (err) => { |
17 | console.log('Succesfully Connected!'); | 17 | console.log('Succesfully Connected!'); |
18 | } | 18 | } |
19 | }); | 19 | }); |
20 | - | 20 | +console.log(__dirname); |
21 | var clothesSchema = new mongoose.Schema({ | 21 | var clothesSchema = new mongoose.Schema({ |
22 | gender: Number, | 22 | gender: Number, |
23 | weather: Number, | 23 | weather: Number, |
... | @@ -56,7 +56,7 @@ app.post('/api/clothes', (req, res) => { | ... | @@ -56,7 +56,7 @@ app.post('/api/clothes', (req, res) => { |
56 | let randb=Math.floor(Math.random()*clothes.bottom.length); | 56 | let randb=Math.floor(Math.random()*clothes.bottom.length); |
57 | if (err) return res.status(500).json({ MatchingSuccess: false }); | 57 | if (err) return res.status(500).json({ MatchingSuccess: false }); |
58 | else if (clothes) { | 58 | else if (clothes) { |
59 | - return res.status(200).json({top:clothes.top[randt],bottom:clothes.bottom[randb]}); | 59 | + return res.status(200).json({top:"../../../../src/img/"+ clothes.top[randt]+".jpg",bottom:"../../../../src/img/"+ clothes.bottom[randb]+".jpg"}); |
60 | } | 60 | } |
61 | else return res.status(404).json({ MatchingSuccess: false }); | 61 | else return res.status(404).json({ MatchingSuccess: false }); |
62 | }); | 62 | }); | ... | ... |
-
Please register or login to post a comment