Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김시환
/
emergency_room_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
EC2 Default User
2022-11-29 10:22:48 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
02d90e0ec4790d4195554ae626c8d85963089cc8
02d90e0e
1 parent
c4e55670
dotenv
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
.gitignore
app.js
Address.js → custom_modules/Address.js
notify_app.js
.gitignore
0 → 100644
View file @
02d90e0
node_modules
.env
\ No newline at end of file
app.js
View file @
02d90e0
const
Address
=
require
(
'./Address.js'
);
const
express
=
require
(
'express'
);
const
request
=
require
(
'request'
);
require
(
"dotenv"
).
config
(
"/home/ec2-user/OSS/Experiments/messenger/chat/custom_modules/.env"
);
// const KAKAO_KEY = process.env.KAKAO_KEY;
const
TOKEN
=
process
.
env
.
CHANNEL_ACCESS_TOKEN
;
const
TARGET_URL
=
'https://api.line.me/v2/bot/message/reply'
const
TOKEN
=
'YK56BfHFgpILrxRk1FZrdcouFguf5CBA5qxM3zfDH6N9jR/cfPxVdK1P9vZHAk69mZDSlSkXNLy25pzqJbXrn3y76hwmH0Kiuvx3OadFYcuidWSp7VYAj4SqJSljv/q5KoYAOE2il8jmQkf4bQKvXQdB04t89/1O/w1cDnyilFU='
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
HTTPS
=
require
(
'https'
);
const
domain
=
"2019102158.oss2022chatbot.tk"
const
domain
=
process
.
env
.
MY_DOMAIN
;
const
sslport
=
23023
;
const
bodyParser
=
require
(
'body-parser'
);
const
app
=
express
();
...
...
Address.js
→
custom_modules/
Address.js
View file @
02d90e0
const
{
response
}
=
require
(
'express'
);
const
fetch
=
require
(
'node-fetch'
)
globalThis
.
fetch
=
fetch
.
fetch
;
const
fetch
=
()
=>
import
(
'node-fetch'
).
then
(({
default
:
fetch
})
=>
fetch
());
require
(
"dotenv"
).
config
(
"/home/ec2-user/project/emergency_room_ChatBot/.env"
);
const
KAKAO_KEY
=
process
.
env
.
KAKAO_KEY
;
var
AddressList
=
new
Array
();
...
...
@@ -12,26 +12,18 @@ function getAddress(currQuery, cb = ()=> {}) {
query
:
currQuery
}),
{
method
:
"GET"
,
headers
:
{
"Authorization"
:
"KakaoAK c14234ba46c574c73715276c5644f397"
}
headers
:
{
"Authorization"
:
KAKAO_KEY
}
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
//console.log(response)
AddressList
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
//console.log(AddressList)
cb
(
AddressList
);
});
},
100
)
}
/*
getAddress('석수동길', function (address) {
console.log(address[0].road_address.address_name);
})
*/
/*
...
...
notify_app.js
View file @
02d90e0
...
...
@@ -2,8 +2,9 @@
const
request
=
require
(
'request'
);
// 요청을 위한 상수를 선언합니다: TOKEN은 자신의 것을 입력해주세요.
const
TARGET_URL
=
'https://notify-api.line.me/api/notify'
;
const
TOKEN
=
'YK56BfHFgpILrxRk1FZrdcouFguf5CBA5qxM3zfDH6N9jR/cfPxVdK1P9vZHAk69mZDSlSkXNLy25pzqJbXrn3y76hwmH0Kiuvx3OadFYcuidWSp7VYAj4SqJSljv/q5KoYAOE2il8jmQkf4bQKvXQdB04t89/1O/w1cDnyilFU='
;
// 요청합니다.
require
(
"dotenv"
).
config
(
"/home/ec2-user/OSS/Experiments/messenger/chat/custom_modules/.env"
);
// const KAKAO_KEY = process.env.KAKAO_KEY;
const
TOKEN
=
process
.
env
.
CHANNEL_ACCESS_TOKEN
;
request
.
post
(
{
url
:
TARGET_URL
,
...
...
Please
register
or
login
to post a comment