김시환

update code

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
})
}
......
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'}
......