Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design2
/
2015104216
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
장준영
2020-12-14 00:17:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
76a5b3ce274d30b79c28eb72796ad23cdfc48041
76a5b3ce
1 parent
2e7d7f81
refactor : BE API response 값 수정
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
server/app.js
server/controller/calcDistance.js
server/package.json
server/app.js
View file @
76a5b3c
...
...
@@ -3,6 +3,7 @@ const express = require('express');
const
path
=
require
(
'path'
);
const
cookieParser
=
require
(
'cookie-parser'
);
const
logger
=
require
(
'morgan'
);
const
cors
=
require
(
'cors'
);
const
indexRouter
=
require
(
'./routes/index'
);
...
...
@@ -17,6 +18,7 @@ app.use(express.json());
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
cookieParser
());
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'public'
)));
app
.
use
(
cors
());
app
.
use
(
'/'
,
indexRouter
);
...
...
server/controller/calcDistance.js
View file @
76a5b3c
...
...
@@ -25,8 +25,8 @@ exports.calcDistance = async (req, res, next) => {
const
minResult
=
Math
.
min
(
rareResult
,
specialRemovedResult
,
specialNotRemovedResult
);
if
(
minResult
<=
1
){
res
.
status
(
200
).
json
({
success
:
true
,
isProfanity
:
"
YES
"
});
res
.
status
(
200
).
json
({
success
:
true
,
isProfanity
:
"
욕설
"
});
}
else
{
res
.
status
(
200
).
json
({
success
:
true
,
isProfanity
:
"
NO
"
});
res
.
status
(
200
).
json
({
success
:
true
,
isProfanity
:
"
정상
"
});
}
};
\ No newline at end of file
...
...
server/package.json
View file @
76a5b3c
...
...
@@ -8,6 +8,7 @@
},
"dependencies"
:
{
"cookie-parser"
:
"~1.4.4"
,
"cors"
:
"^2.8.5"
,
"debug"
:
"~2.6.9"
,
"dotenv"
:
"^8.2.0"
,
"express"
:
"~4.16.1"
,
...
...
Please
register
or
login
to post a comment