Seokjin

[UPDATE]tomorrow,weather

...@@ -64,16 +64,18 @@ app.post('/api/address', (req, res) => { ...@@ -64,16 +64,18 @@ app.post('/api/address', (req, res) => {
64 let a3=[], a4=[], a5=[], a6=[], a7=[], a8=[], a9=[], a10=[], a11=[], a12=[], a13=[], a14=[], a15=[], a16=[], a17=[], a18=[], a19=[], a20=[], a21=[], a22=[], a23=[]; 64 let a3=[], a4=[], a5=[], a6=[], a7=[], a8=[], a9=[], a10=[], a11=[], a12=[], a13=[], a14=[], a15=[], a16=[], a17=[], a18=[], a19=[], a20=[], a21=[], a22=[], a23=[];
65 //입력받기 65 //입력받기
66 app.post('/api/weather',(req,res)=>{ 66 app.post('/api/weather',(req,res)=>{
67 - const nx = req.body.dotX; 67 + let Nx = req.body.dotX;
68 - const ny = req.body.dotY; 68 + let Ny = req.body.dotY;
69 + var queryParams = '?' + encodeURIComponent('serviceKey') + '=3OcUyvx97Vx2YikiZ9IHyRQ6suapku7Xn8VlefQKQWrGIFOGaejhbevwagcubdHfSiQAqJwCV5lyIutw0%2BsppA%3D%3D'; /* Service Key*/
70 + var url = 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst';
69 71
70 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */ 72 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */
71 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */ 73 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */
72 queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */ 74 queryParams += '&' + encodeURIComponent('dataType') + '=' + encodeURIComponent('JSON'); /* */
73 queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(base); /* */ 75 queryParams += '&' + encodeURIComponent('base_date') + '=' + encodeURIComponent(base); /* */
74 queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2300'); /* */ 76 queryParams += '&' + encodeURIComponent('base_time') + '=' + encodeURIComponent('2300'); /* */
75 - queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(nx); /*nx*/ 77 + queryParams += '&' + encodeURIComponent('nx') + '=' + encodeURIComponent(Nx); /*nx*/
76 - queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(ny); /*ny*/ 78 + queryParams += '&' + encodeURIComponent('ny') + '=' + encodeURIComponent(Ny); /*ny*/
77 79
78 request({ 80 request({
79 url: url + queryParams, 81 url: url + queryParams,
...@@ -119,6 +121,8 @@ app.post('/api/weather',(req,res)=>{ ...@@ -119,6 +121,8 @@ app.post('/api/weather',(req,res)=>{
119 app.post('/api/tommorow',(req,res)=>{ 121 app.post('/api/tommorow',(req,res)=>{
120 const nx = req.body.dotX; 122 const nx = req.body.dotX;
121 const ny = req.body.dotY; 123 const ny = req.body.dotY;
124 + var queryParams = '?' + encodeURIComponent('serviceKey') + '=3OcUyvx97Vx2YikiZ9IHyRQ6suapku7Xn8VlefQKQWrGIFOGaejhbevwagcubdHfSiQAqJwCV5lyIutw0%2BsppA%3D%3D'; /* Service Key*/
125 + var url = 'http://apis.data.go.kr/1360000/VilageFcstInfoService_2.0/getVilageFcst';
122 126
123 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */ 127 queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */
124 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */ 128 queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('1000'); /* */
......