Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2019-2-OpenSourceSW
/
Probability Death
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
배희수
2018-12-05 22:33:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
unknown
2018-12-06 16:34:28 +0900
Commit
3ac172eeab1dc5faa06154dc29c29ee814e57ed4
3ac172ee
1 parent
eef3c7c7
mysql 개발 환경 구축 및 생활 기상 지수/사망확률 변수 정의
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletions
package-lock.json
package.json
routes/index.js
package-lock.json
View file @
3ac172e
This diff is collapsed. Click to expand it.
package.json
View file @
3ac172e
...
...
@@ -16,6 +16,7 @@
"http-errors"
:
"~1.6.2"
,
"morgan"
:
"~1.9.0"
,
"request"
:
"^2.88.0"
,
"mysql"
:
"^2.16.0"
,
"socket.io"
:
"^2.1.1"
}
}
...
...
routes/index.js
View file @
3ac172e
var
express
=
require
(
'express'
);
var
router
=
express
.
Router
();
var
mysql
=
require
(
'mysql'
);
var
connection
=
mysql
.
createConnection
({
host
:
'ryulth.com'
,
user
:
'kkonzi'
,
password
:
'kkonzi1234'
,
database
:
'kkonzi_test'
});
/* GET home page. */
router
.
get
(
'/'
,
function
(
req
,
res
,
next
)
{
res
.
render
(
'index'
,
{
title
:
'Express'
});
// mysql 세션 연결
connection
.
connect
();
// connection.query('SELECT * FROM ');
// 자외선지수, 불쾌지수, 열지수, 체감 온도, 바람속도, 현재기온, 하늘 상태, 강우량, 태풍, 낙뢰
var
uvr
,
discomfort
,
heat
,
sensibleTem
,
windSpeed
,
presentTem
,
skyState
,
rainfall
,
typhoon
,
lightning
;
// 사망 확률
var
deathProb
;
deathProb
=
uvr
+
discomfort
+
heat
+
sensibleTem
+
windSpeed
+
presentTem
+
skyState
+
rainfall
+
typhoon
+
lightning
;
res
.
render
(
'index'
,
{
title
:
'Express'
});
connecttion
.
end
();
});
module
.
exports
=
router
;
...
...
Please
register
or
login
to post a comment