Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김건희
/
OSSW_Weather_Briefing
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Seokjin
2022-06-05 18:46:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
00f0abab9607bf4ecc2fe7ac6e8f53d7630d5f5b
00f0abab
1 parent
c165ca23
[UPDATE]filelocation
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
weather_briefing/server/clothes.js
weather_briefing/server/clothes.js
View file @
00f0aba
...
...
@@ -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
});
});
...
...
Please
register
or
login
to post a comment