Toggle navigation
Toggle navigation
This project
Loading...
Sign in
고다경
/
Open_Source_project
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
김용재
2019-06-06 23:28:37 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1a26792081e3368a11fe3c74d0354896dee0b417
1a267920
1 parent
eda9625e
db로 bmi 나타냈다
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
21 deletions
contents/Result.html
db.json
main.js
sessions/ux-K3tuuORCyAjuvKFX52l2S_CX7MsGy.json → sessions/GBcybOhPLf1veWWFBWGgzx633Tqdb5G3.json
contents/Result.html
View file @
1a26792
...
...
@@ -3,3 +3,5 @@
<input
id =
"logout"
type=
"submit"
value=
"Logout"
class=
"btn btn-default"
style=
" width:100px;font-weight: bold; font-size: 18px; background-color: white;"
>
</form>
<br><br><br>
...
...
db.json
View file @
1a26792
{
"users"
:
[
{
"ID"
:
"1"
,
"password"
:
"1"
,
"age"
:
"1"
,
"gender"
:
"male"
,
"height"
:
"1"
,
"weight"
:
"1"
}
]
"users"
:
[]
}
\ No newline at end of file
...
...
main.js
View file @
1a26792
...
...
@@ -38,6 +38,8 @@ var foodkind;
var
ingr
;
var
sID
;
app
.
use
(
function
(
req
,
res
,
next
)
{
res
.
header
(
"Access-Control-Allow-Origin"
,
"*"
);
res
.
header
(
"Access-Control-Allow-Headers"
,
"Origin, X-Requested-With, Content-Type, Accept"
);
...
...
@@ -67,18 +69,12 @@ app.get('/', function(request, response) {
var
user
=
db
.
get
(
'users'
).
find
({
ID
:
ID
,
password
:
password
}).
value
();
if
(
user
){
request
.
session
.
is_logined
=
true
;
request
.
session
.
ID
=
ID
;
sID
=
ID
;
request
.
session
.
save
(
function
(){
response
.
redirect
(
'/InputPage'
)
});
}
});
app
.
get
(
'/signup'
,
function
(
request
,
response
)
{
...
...
@@ -146,8 +142,9 @@ app.get('/', function(request, response) {
var
ch
=
'5ch'
var
jresult
=
JSON
.
parse
(
result
);
var
cal
=
jresult
.
calories
;
var
ccc
=
container
.
L
(
`<h2>칼로리 :
${
cal
}
kcal`
,
''
,
''
)
var
user
=
db
.
get
(
'users'
).
find
({
ID
:
sID
}).
value
();
var
bmi
=
user
.
weight
/
(
user
.
height
*
user
.
height
/
100
/
100
);
var
ccc
=
container
.
L
(
`<h2>칼로리 :
${
cal
}
kcal`
,
''
,
`<h2>bmi:
${
bmi
}
</h2>`
)
var
html
=
template
.
HTML
(
title
,
ch
,
``
,
body
,
`#logout{
position:absolute;
right: 20ch;
...
...
sessions/
ux-K3tuuORCyAjuvKFX52l2S_CX7MsGy
.json
→
sessions/
GBcybOhPLf1veWWFBWGgzx633Tqdb5G3
.json
View file @
1a26792
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1559828237372
}
\ No newline at end of file
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1559831147957
,
"is_logined"
:
true
,
"ID"
:
"2"
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment