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-22 16:52:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fc138db1820050c0483a427e90ca144de074c219
fc138db1
0 parents
first
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
app.js
app.js
0 → 100644
View file @
fc138db
var
express
=
require
(
'express'
);
var
http
=
require
(
'http'
);
var
bodyParser
=
require
(
'body-parser'
);
var
app
=
express
();
app
.
get
(
'/keyboard'
,
function
(
req
,
res
){
var
data
=
{
'type'
:
'buttons'
,
'buttons'
:
[
'질문'
,
'컬러'
,
'정보'
]
};
res
.
json
(
data
);
});
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
app
.
use
(
bodyParser
.
json
());
app
.
post
(
'/message'
,
function
(
req
,
res
){
var
msg
=
req
.
body
.
content
;
console
.
log
(
'전달받은 메세지: '
+
msg
);
var
send
=
{};
switch
(
msg
){
case
'pink'
:
send
=
{
}
break
;
case
'orange'
:
send
=
{
}
break
;
default
:
send
=
{
}
break
;
}
res
.
json
(
send
);
})
http
.
createServer
(
app
).
listen
(
9090
,
function
(){
console
.
log
(
'서버실행중..'
);
});
\ No newline at end of file
Please
register
or
login
to post a comment