Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김동진
/
HealthProtector
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
김동진
2020-11-28 22:10:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3a1b8faa912ae1038b2f0fad5cbb4d675cab7b34
3a1b8faa
1 parent
44791282
AWS DRS 사용하여 DB연결
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
17 deletions
food.sql/food_fooddb.sql
lib/db.js
lib/template.js
main.js
package.json
food.sql/food_fooddb.sql
0 → 100644
View file @
3a1b8fa
This diff could not be displayed because it is too large.
lib/db.js
View file @
3a1b8fa
var
mysql
=
require
(
'mysql'
);
var
db
=
mysql
.
createConnection
({
host
:
"localhost"
,
user
:
"root"
,
password
:
"kdj0630"
,
database
:
"food"
,
host
:
"myfooddb.czvswclxcy8d.us-east-1.rds.amazonaws.com"
,
user
:
"user"
,
password
:
"user1234"
,
port
:
3306
,
database
:
'food'
});
db
.
connect
();
module
.
exports
=
db
;
\ No newline at end of file
...
...
lib/template.js
View file @
3a1b8fa
...
...
@@ -9,9 +9,7 @@ module.exports = {
<title>HelP -
${
title
}
</title>
<meta charset="utf-8" />
</head>
<body>
<<<<<<< HEAD
<body>
<style>
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR&display=swap');
</style>
...
...
@@ -40,21 +38,20 @@ module.exports = {
<h4 style="font-family: 'Jua', sans-serif;"><font color="gray">자신에게 맞는 일일 권장 섭취량(kcal)를 계산해보세요!</h4>
</div>
<div style= width:47%;float:right;font-size:20px;padding:0px;>
<h2 style="font-family: 'Jua', sans-serif;"><a href="
2.html
"><font color="black">음식별 영양정보</a></h2>
<h2 style="font-family: 'Jua', sans-serif;"><a href="
/foodInfo
"><font color="black">음식별 영양정보</a></h2>
<h4 style="font-family: 'Jua', sans-serif;"><font color="gray">음식별 식품 영양정보에 대해 알려드립니다!</h4>
</div>
<br><br><br><br><br>
=======
<h1><a href="/">HealthProtector</a></h1>
<ol>
<li><a href="/countKcal">칼로리 계산</a></li>
<li><a href="/foodInfo">음식별 영양정보</a></li>
</ol>
>>>>>>> 1f4c622c1f957db4e7fadc6a311608a77210ef1f
${
body
}
<div style= width:100%;font-size:10px;position:fixed;bottom:0;float:left;padding:0px;background-color:#0B610B;>
<h4><a href="
2.html
"><font color="white">Copyright HealThProtector 2020</a></h4>
<h4><a href="
/foodInfo
"><font color="white">Copyright HealThProtector 2020</a></h4>
</div>
</body>
</html>
...
...
main.js
View file @
3a1b8fa
...
...
@@ -65,7 +65,7 @@ var app = http.createServer(function(request,response){
var
num
=
0
;
// 검색된 개수
var
foodName
=
''
;
var
list
=
[];
//console.log(typeof(foodInfo[0].id)
);
console
.
log
(
foodInfo
[
0
]
);
for
(
var
i
=
0
;
i
<
foodInfo
.
length
;
i
++
){
foodName
=
foodInfo
[
i
].
name
;
if
(
foodName
.
indexOf
(
search
)
>=
0
){
...
...
@@ -108,7 +108,7 @@ var app = http.createServer(function(request,response){
});
request
.
on
(
'end'
,
function
(){
var
post
=
qs
.
parse
(
body
);
console
.
log
(
post
);
db
.
query
(
`SELECT * FROM fooddb`
,
function
(
error
,
foodInfo
)
{
var
title
=
'음식 영양정보'
;
var
description
=
'음식을 검색하면 음식의 칼로리, 탄수화물, 단백질, 지방, 나트륨의 정보를 알려드립니다!'
;
...
...
package.json
View file @
3a1b8fa
...
...
@@ -7,7 +7,7 @@
},
"author"
:
""
,
"license"
:
"ISC"
,
<<<<<<<
HEAD
"directories"
:
{
"lib"
:
"lib"
},
...
...
@@ -16,11 +16,9 @@
"url"
:
"http://khuhub.khu.ac.kr/2019102154/HealthProtector.git"
},
"description"
:
""
,
"dependencies"
:
{
=======
"dependencies"
:
{
"mysql"
:
"^2.18.1"
,
>>>>>>>
1
f
4
c
622
c
1
f
957
db
4
e
7
fadc
6
a
311608
a
77210
ef
1
f
"react"
:
"^17.0.1"
,
"react-dom"
:
"^17.0.1"
}
...
...
Please
register
or
login
to post a comment