Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MotherProject
/
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
Commit
52496da3f6867c9da9978f0f35ecf6a9015ef465
52496da3
1 parent
dc48e761
mysql 개발 환경 구축 및 생활 기상 지수/사망확률 변수 정의
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
package-lock.json
package.json
routes/index.js
package-lock.json
View file @
52496da
This diff is collapsed. Click to expand it.
package.json
View file @
52496da
...
...
@@ -12,9 +12,10 @@
"debug"
:
"~2.6.9"
,
"ejs"
:
"~2.5.7"
,
"express"
:
"~4.16.0"
,
"helmet"
:
"^3.13.0"
,
"http-errors"
:
"~1.6.2"
,
"morgan"
:
"~1.9.0"
,
"
helmet"
:
"^3.13
.0"
,
"
mysql"
:
"^2.16
.0"
,
"socket.io"
:
"^2.1.1"
}
}
...
...
routes/index.js
View file @
52496da
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