곽태식

success access kk

...@@ -42,7 +42,7 @@ app.use(function(err, req, res, next) { ...@@ -42,7 +42,7 @@ app.use(function(err, req, res, next) {
42 res.render('error'); 42 res.render('error');
43 }); 43 });
44 44
45 -server.listen(80); 45 +server.listen(8099);
46 SOCKETIO(server,app); 46 SOCKETIO(server,app);
47 47
48 module.exports = app; 48 module.exports = app;
......
1 -module.exporst = {
2 - host : 'localhost',
3 - user : 'root',
4 - password : 'Dltgld55%%',
5 - port : 3306,
6 - database : 'my_db'
7 -};
...\ No newline at end of file ...\ No newline at end of file
1 -const mysql = require('mysql'); 1 +var mysql = require('mysql');
2 -const option = require('./db_option'); 2 +var option = require('./db_option');
3 -const connection = mysql.createConnection(option); 3 +var connection = mysql.createConnection(option);
4 4
5 connection.connect(); 5 connection.connect();
6 6
......
...@@ -124,7 +124,7 @@ module.exports = (server, app) => { ...@@ -124,7 +124,7 @@ module.exports = (server, app) => {
124 console.log("emit"); 124 console.log("emit");
125 125
126 //db에 저장 126 //db에 저장
127 - sql = "INSERT INTO weatherInfo (time,wind,temperature,rain,prob) VALUES (?,?,?,?,?)"; 127 + sql = "INSERT INTO weather_info (time,wind,temperature,rain,prob) VALUES (?,?,?,?,?)";
128 db.query(sql, [client_send.time, client_send.wind, client_send.temperature, client_send.rain, client_send.death], (err, result) => { 128 db.query(sql, [client_send.time, client_send.wind, client_send.temperature, client_send.rain, client_send.death], (err, result) => {
129 if (err) console.log(err); 129 if (err) console.log(err);
130 }) 130 })
......
...@@ -23,7 +23,7 @@ router.get('/name/:name/birth/:birth', (req,res) => { ...@@ -23,7 +23,7 @@ router.get('/name/:name/birth/:birth', (req,res) => {
23 const birth = req.params.birth; 23 const birth = req.params.birth;
24 24
25 // 이전 10분간 데이터 찾기 25 // 이전 10분간 데이터 찾기
26 - sql = "SELECT * FROM weatherInfo WHERE time >= DATE_FORMAT(DATE_ADD(now(), INTERVAL -20 MINUTE), '%Y-%m-%d %H:%i:%s')"; 26 + sql = "SELECT * FROM weather_info WHERE time >= DATE_FORMAT(DATE_ADD(now(), INTERVAL -20 MINUTE), '%Y-%m-%d %H:%i:%s')";
27 db.query(sql, function(err, rows, fields){ 27 db.query(sql, function(err, rows, fields){
28 if(err) 28 if(err)
29 { 29 {
......