공태현

Update squart.html

......@@ -51,6 +51,10 @@ app.get('/', (req,res) => {
app.get('/main.js', (req,res) => {
res.sendFile( __dirname + '/views/mainPage/main.js')
})
// js 파일 전송.
app.get('/squart.js', (req,res) => {
res.sendFile( __dirname + '/views/squartPage/squart.js')
})
app.get('/squart', (req,res) => {
if (req.session.user)
......@@ -158,7 +162,7 @@ app.get('/api/users/logout', (req,res) => {
})
// 스쿼트 갯수 업데이트 API
app.post('/api/users/countupdate', (req,res) => {
var userName = req.body.name
var userCount = req.body.count
......
......@@ -22,5 +22,12 @@
로그인
</button>
</div>
<div>
<input id = "register_name" type = "text" placeholder="이름">
<input id = "register_password" type = "text" placeholder = "비밀번호">
<button type = "submit" id = "register_button">
회원가입
</button>
</div>
</body>
</html>
\ No newline at end of file
......
......@@ -38,3 +38,34 @@ $(document).ready(function(){
})
})
})
// 회원가입용
$(document).ready(function(){
$('#register_button').click(function(){
let sendName = $('#register_name').val();
let sendPassword = $('#register_password').val();
let sendData = {
"name" : sendName,
"password" : sendPassword
}
$.ajax({
contentType : "application/json; charset=utf-8",
type : 'post',
url : 'api/users/register',
data : JSON.stringify(sendData),
dataType : 'JSON',
success : function(datas) {
if (datas.success)
{
moveSquartPage()
}
else
{
alert("회원가입 실패 (이름 중복 의심)")
}
}
})
})
})
......
......@@ -7,9 +7,14 @@
<title>Squart Page</title>
</head>
<body>
<div>Teachable Machine Pose Model - Squart</div>
<div>온라인 헬스 케어 서비스 (스쿼트)</div>
<div>
<script src = "./squart.js"></script>
<sapn id = "user_count">0</sapn>
</div>
<button type="button" onclick="init()">Start</button>
<div><canvas id="canvas"></canvas></div>
<div id="label-container"></div>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/pose@0.8/dist/teachablemachine-pose.min.js"></script>
......