김시환

update code

1 -import fetch from "node-fetch"; 1 +const { response } = require('express');
2 -globalThis.fetch = fetch; 2 +const fetch = require('node-fetch')
3 +
4 +globalThis.fetch = fetch.fetch;
3 5
4 var AddressList = new Array(); 6 var AddressList = new Array();
5 7
...@@ -13,8 +15,9 @@ function getAddress(currQuery) { ...@@ -13,8 +15,9 @@ function getAddress(currQuery) {
13 }) 15 })
14 .then(response => response.json()) 16 .then(response => response.json())
15 .then(data => { 17 .then(data => {
18 + console.log(response)
16 AddressList = data.documents.map(({road_address})=>({road_address})); 19 AddressList = data.documents.map(({road_address})=>({road_address}));
17 - // console.log(currAddress) 20 + console.log(AddressList)
18 return AddressList 21 return AddressList
19 }) 22 })
20 } 23 }
......
1 +const Address = require('./Address.js');
1 const express = require('express'); 2 const express = require('express');
2 const app = express(); 3 const app = express();
3 4
5 +
6 +console.log(Address.getAddress('석수동길'));
7 +
4 app.use(express.urlencoded({ extended: false })); 8 app.use(express.urlencoded({ extended: false }));
5 app.use(express.json()); 9 app.use(express.json());
6 10
...@@ -8,6 +12,16 @@ app.get('',(req,res)=> { ...@@ -8,6 +12,16 @@ app.get('',(req,res)=> {
8 res.send('tset') 12 res.send('tset')
9 }) 13 })
10 14
15 +app.post('/hook', function(request,response){
16 + var eventObj = request.body.events[0];
17 +
18 + console.log("---------------",new Date(),"-----------------");
19 + response.sendStatus(200);
20 +
21 +
22 +
23 +})
24 +
11 25
12 app.get('/keyboard', (req, res) => { 26 app.get('/keyboard', (req, res) => {
13 const data = {'type': 'text'} 27 const data = {'type': 'text'}
......