Showing
3 changed files
with
22 additions
and
1 deletions
This diff is collapsed. Click to expand it.
1 | var express = require('express'); | 1 | var express = require('express'); |
2 | var router = express.Router(); | 2 | var router = express.Router(); |
3 | +var mysql = require('mysql'); | ||
4 | + | ||
5 | +var connection = mysql.createConnection({ | ||
6 | + host : 'ryulth.com', | ||
7 | + user : 'kkonzi', | ||
8 | + password : 'kkonzi1234', | ||
9 | + database : 'kkonzi_test' | ||
10 | +}); | ||
3 | 11 | ||
4 | /* GET home page. */ | 12 | /* GET home page. */ |
5 | router.get('/', function(req, res, next) { | 13 | router.get('/', function(req, res, next) { |
6 | - res.render('index', { title: 'Express' }); | 14 | + // mysql 세션 연결 |
15 | + connection.connect(); | ||
16 | + // connection.query('SELECT * FROM '); | ||
17 | + | ||
18 | + // 자외선지수, 불쾌지수, 열지수, 체감 온도, 바람속도, 현재기온, 하늘 상태, 강우량, 태풍, 낙뢰 | ||
19 | + var uvr, discomfort, heat, sensibleTem, windSpeed, presentTem, skyState, rainfall, typhoon, lightning; | ||
20 | + // 사망 확률 | ||
21 | + var deathProb; | ||
22 | + | ||
23 | + deathProb = uvr + discomfort + heat + sensibleTem + windSpeed + presentTem + skyState + rainfall + typhoon + lightning; | ||
24 | + res.render('index', {title: 'Express'}); | ||
25 | + | ||
26 | + connecttion.end(); | ||
7 | }); | 27 | }); |
8 | 28 | ||
9 | module.exports = router; | 29 | module.exports = router; | ... | ... |
-
Please register or login to post a comment