Ubuntu

setting aws and correct config

...@@ -39,8 +39,8 @@ build/Release ...@@ -39,8 +39,8 @@ build/Release
39 # Dependency directories 39 # Dependency directories
40 node_modules/ 40 node_modules/
41 jspm_packages/ 41 jspm_packages/
42 -keys/api_option.js 42 +keys/api_option
43 -keys/db_option.js 43 +keys/db_option
44 # TypeScript v1 declaration files 44 # TypeScript v1 declaration files
45 typings/ 45 typings/
46 46
...@@ -78,4 +78,4 @@ typings/ ...@@ -78,4 +78,4 @@ typings/
78 .serverless 78 .serverless
79 79
80 80
81 -# End of https://www.gitignore.io/api/node
...\ No newline at end of file ...\ No newline at end of file
81 +# End of https://www.gitignore.io/api/node
......
1 const mysql = require('mysql'); 1 const mysql = require('mysql');
2 -const DB_option = require('../keys/db_option'); 2 +const DB_option = require('./keys/db_option');
3 3
4 module.exports = mysql.createConnection(DB_option); 4 module.exports = mysql.createConnection(DB_option);
......
1 +module.exports = {
2 +key : "9a433f5f-c41c-4f7f-a02e-238a74e3d716"};
1 +module.exports = {
2 + host: 'localhost',
3 + user: 'root',
4 + password: 'rkdud0520',
5 + port: 3306,
6 + database: 'weather'
7 +};
1 const db = require('./db.js'); 1 const db = require('./db.js');
2 -const secret_key = require('../keys/api_option').key; 2 +const secret_key = require('./keys/api_option').key;
3 const requesting = require('request'); 3 const requesting = require('request');
4 const lat = "37.239795"; 4 const lat = "37.239795";
5 const lon = "127.083240"; 5 const lon = "127.083240";
...@@ -28,7 +28,7 @@ module.exports = (server, app) => { ...@@ -28,7 +28,7 @@ module.exports = (server, app) => {
28 return new Promise((resolve, reject) => { 28 return new Promise((resolve, reject) => {
29 requesting.get({ 29 requesting.get({
30 // api를 요청할 주소 -- 시크릿키,위도,경도 입력 30 // api를 요청할 주소 -- 시크릿키,위도,경도 입력
31 - url: `https://api2.sktelecom.com/weather/${when}/${what}?appKey=${secret_key}&lat=${lat}&lon=${lon}`, 31 + url: `https://api2.sktelecom.com/weather/${when}/${what}?lat=${lat}&lon=${lon}&appKey=${secret_key}`,
32 json: true 32 json: true
33 }, 33 },
34 //api에게 응답 받았을때 실행되는 callback function 34 //api에게 응답 받았을때 실행되는 callback function
......
This diff is collapsed. Click to expand it.