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
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김시환
2022-11-21 20:43:50 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2e13170ca7367f71db74f9c039a9fac9f4d1f466
2e13170c
1 parent
3c601a87
update code
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
Address.js
app.js
Address.js
View file @
2e13170
import
fetch
from
"node-fetch"
;
globalThis
.
fetch
=
fetch
;
const
{
response
}
=
require
(
'express'
);
const
fetch
=
require
(
'node-fetch'
)
globalThis
.
fetch
=
fetch
.
fetch
;
var
AddressList
=
new
Array
();
...
...
@@ -13,8 +15,9 @@ function getAddress(currQuery) {
})
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
console
.
log
(
response
)
AddressList
=
data
.
documents
.
map
(({
road_address
})
=>
({
road_address
}));
// console.log(currAddress
)
console
.
log
(
AddressList
)
return
AddressList
})
}
...
...
app.js
View file @
2e13170
const
Address
=
require
(
'./Address.js'
);
const
express
=
require
(
'express'
);
const
app
=
express
();
console
.
log
(
Address
.
getAddress
(
'석수동길'
));
app
.
use
(
express
.
urlencoded
({
extended
:
false
}));
app
.
use
(
express
.
json
());
...
...
@@ -8,6 +12,16 @@ app.get('',(req,res)=> {
res
.
send
(
'tset'
)
})
app
.
post
(
'/hook'
,
function
(
request
,
response
){
var
eventObj
=
request
.
body
.
events
[
0
];
console
.
log
(
"---------------"
,
new
Date
(),
"-----------------"
);
response
.
sendStatus
(
200
);
})
app
.
get
(
'/keyboard'
,
(
req
,
res
)
=>
{
const
data
=
{
'type'
:
'text'
}
...
...
Please
register
or
login
to post a comment