Toggle navigation
Toggle navigation
This project
Loading...
Sign in
오규림
/
Personal_color_chatbot
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
오규림
2021-05-23 16:35:54 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
617d16ad203392a5a9bb5a1427a6e9dbc176c48e
617d16ad
2 parents
fc138db1
45e5b33c
Merge branch 'master' into 'master'
change buttons See merge request
!2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
24 deletions
app.js
app.js
View file @
617d16a
var
express
=
require
(
'express'
);
var
express
=
require
(
"express"
);
var
http
=
require
(
'http'
);
var
http
=
require
(
"http"
);
var
bodyParser
=
require
(
'body-parser'
);
var
bodyParser
=
require
(
"body-parser"
);
var
app
=
express
();
app
.
get
(
'/keyboard'
,
function
(
req
,
res
){
var
data
=
{
'type'
:
'buttons'
,
'buttons'
:
[
'질문'
,
'컬러'
,
'정보'
]
app
.
get
(
"/Personal_color_chatbot"
,
function
(
req
,
res
)
{
var
data
=
{
type
:
"buttons"
,
buttons
:
[
"퍼스널 컬러 진단하기"
,
"봄웜"
,
"여름쿨"
,
"가을웜"
,
"겨울쿨"
],
};
res
.
json
(
data
);
});
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
app
.
use
(
bodyParser
.
json
());
app
.
post
(
'/message'
,
function
(
req
,
res
){
app
.
post
(
"/message"
,
function
(
req
,
res
)
{
var
msg
=
req
.
body
.
content
;
console
.
log
(
'전달받은 메세지: '
+
msg
);
console
.
log
(
"전달받은 메세지: "
+
msg
);
var
send
=
{};
var
send
=
{};
switch
(
msg
)
{
case
'pink'
:
switch
(
msg
)
{
case
"퍼스널 컬러 진단하기"
:
send
=
{
message
:
{
text
:
"퍼스널 컬러 진단하기 선택"
,
},
};
break
;
}
case
"봄웜"
:
send
=
{
message
:
{
text
:
"봄웜 선택"
,
},
};
break
;
case
'orange'
:
send
=
{
case
"여름쿨"
:
send
=
{
message
:
{
text
:
"여름쿨 선택"
,
},
};
break
;
}
case
"가을웜"
:
send
=
{
message
:
{
text
:
"가을웜 선택"
,
},
};
break
;
default
:
case
"겨울쿨"
:
send
=
{
message
:
{
text
:
"겨을쿨 선택"
,
},
};
break
;
}
default
:
send
=
{
message
:
{
text
:
"알 수 없는 명령입니다."
,
},
};
break
;
}
res
.
json
(
send
);
})
})
;
http
.
createServer
(
app
).
listen
(
9090
,
function
()
{
console
.
log
(
'서버실행중..'
);
http
.
createServer
(
app
).
listen
(
9090
,
function
()
{
console
.
log
(
"서버실행중.."
);
});
...
...
Please
register
or
login
to post a comment