Toggle navigation
Toggle navigation
This project
Loading...
Sign in
장재훈
/
TFT_Chat_Bot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
장재훈
2020-06-23 15:47:10 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
78ace778e0b6a7bc90a2156d1b61255eb94abe53
78ace778
1 parent
807a9f3e
modify app.js
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
49 deletions
data/app.js
data/package-lock.json
data/app.js
View file @
78ace77
...
...
@@ -7,50 +7,47 @@ const apiRouter = express.Router();
app
.
use
(
logger
(
'dev'
,
{}));
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
app
.
use
(
'/api'
,
apiRouter
);
apiRouter
.
post
(
'/champion'
,
function
(
req
,
res
)
{
res
.
send
(
"Hello,world!"
);
/*
const responsebody = {
"version": "2.0",
"template": {
"outputs": [
{
"basicCard": {
"title": "보물상자",
"description": "보물상자 안에는 뭐가 있을까",
"thumbnail": {
"imageUrl": "http://k.kakaocdn.net/dn/83BvP/bl20duRC1Q1/lj3JUcmrzC53YIjNDkqbWK/i_6piz1p.jpg"
},
"profile": {
"imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT4BJ9LU4Ikr_EvZLmijfcjzQKMRCJ2bO3A8SVKNuQ78zu2KOqM",
"nickname": "보물상자"
},
"social": {
"like": 1238,
"comment": 8,
"share": 780
},
"buttons": [
{
"action": "message",
"label": "열어보기",
"messageText": "짜잔! 우리가 찾던 보물입니다"
},
{
"action": "webLink",
"label": "구경하기",
"webLinkUrl": "https://e.kakao.com/t/hello-ryan"
}
]
}
}
]
}
};
*/
apiRouter
.
post
(
'/sayHello'
,
function
(
req
,
res
)
{
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
outputs
:
[
{
simpleText
:
{
text
:
"hello I'm Ryan"
}
}
]
}
};
res
.
status
(
200
).
send
(
responseBody
);
});
apiRouter
.
post
(
'/showHello'
,
function
(
req
,
res
)
{
console
.
log
(
req
.
body
);
const
responseBody
=
{
version
:
"2.0"
,
template
:
{
outputs
:
[
{
simpleImage
:
{
imageUrl
:
"https://t1.daumcdn.net/friends/prod/category/M001_friends_ryan2.jpg"
,
altText
:
"hello I'm Ryan"
}
}
]
}
};
res
.
status
(
200
).
send
(
responseBody
);
});
/*
const fs = require('fs');
...
...
@@ -68,6 +65,7 @@ app.post('/champion',function(req,res){
})
app.get('/', function(req, res){
res.send('Hello, World!');
})
...
...
@@ -84,10 +82,7 @@ app.get('/users/:userId/books/:bookId', function(req, res){
console.log(req.params.bookId)
res.send(req.params);
})
var server = app.listen(23023, function(){
var host = server.address().address
var port = server.address().port
console.log("Example app listening at https://tft-helper.tk", host, port)
})
*/
\ No newline at end of file
*/
app
.
listen
(
3000
,
function
(){
console
.
log
(
"Example skill server listening on port 3000!"
);
});
...
...
data/package-lock.json
0 → 100644
View file @
78ace77
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment