Showing
5 changed files
with
49 additions
and
2 deletions
... | @@ -51,6 +51,10 @@ app.get('/', (req,res) => { | ... | @@ -51,6 +51,10 @@ app.get('/', (req,res) => { |
51 | app.get('/main.js', (req,res) => { | 51 | app.get('/main.js', (req,res) => { |
52 | res.sendFile( __dirname + '/views/mainPage/main.js') | 52 | res.sendFile( __dirname + '/views/mainPage/main.js') |
53 | }) | 53 | }) |
54 | +// js 파일 전송. | ||
55 | +app.get('/squart.js', (req,res) => { | ||
56 | + res.sendFile( __dirname + '/views/squartPage/squart.js') | ||
57 | +}) | ||
54 | 58 | ||
55 | app.get('/squart', (req,res) => { | 59 | app.get('/squart', (req,res) => { |
56 | if (req.session.user) | 60 | if (req.session.user) |
... | @@ -158,7 +162,7 @@ app.get('/api/users/logout', (req,res) => { | ... | @@ -158,7 +162,7 @@ app.get('/api/users/logout', (req,res) => { |
158 | 162 | ||
159 | }) | 163 | }) |
160 | 164 | ||
161 | - | 165 | +// 스쿼트 갯수 업데이트 API |
162 | app.post('/api/users/countupdate', (req,res) => { | 166 | app.post('/api/users/countupdate', (req,res) => { |
163 | var userName = req.body.name | 167 | var userName = req.body.name |
164 | var userCount = req.body.count | 168 | var userCount = req.body.count | ... | ... |
... | @@ -22,5 +22,12 @@ | ... | @@ -22,5 +22,12 @@ |
22 | 로그인 | 22 | 로그인 |
23 | </button> | 23 | </button> |
24 | </div> | 24 | </div> |
25 | + <div> | ||
26 | + <input id = "register_name" type = "text" placeholder="이름"> | ||
27 | + <input id = "register_password" type = "text" placeholder = "비밀번호"> | ||
28 | + <button type = "submit" id = "register_button"> | ||
29 | + 회원가입 | ||
30 | + </button> | ||
31 | + </div> | ||
25 | </body> | 32 | </body> |
26 | </html> | 33 | </html> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -38,3 +38,34 @@ $(document).ready(function(){ | ... | @@ -38,3 +38,34 @@ $(document).ready(function(){ |
38 | }) | 38 | }) |
39 | }) | 39 | }) |
40 | }) | 40 | }) |
41 | +// 회원가입용 | ||
42 | +$(document).ready(function(){ | ||
43 | + $('#register_button').click(function(){ | ||
44 | + let sendName = $('#register_name').val(); | ||
45 | + let sendPassword = $('#register_password').val(); | ||
46 | + | ||
47 | + let sendData = { | ||
48 | + "name" : sendName, | ||
49 | + "password" : sendPassword | ||
50 | + } | ||
51 | + | ||
52 | + $.ajax({ | ||
53 | + contentType : "application/json; charset=utf-8", | ||
54 | + type : 'post', | ||
55 | + url : 'api/users/register', | ||
56 | + data : JSON.stringify(sendData), | ||
57 | + dataType : 'JSON', | ||
58 | + | ||
59 | + success : function(datas) { | ||
60 | + if (datas.success) | ||
61 | + { | ||
62 | + moveSquartPage() | ||
63 | + } | ||
64 | + else | ||
65 | + { | ||
66 | + alert("회원가입 실패 (이름 중복 의심)") | ||
67 | + } | ||
68 | + } | ||
69 | + }) | ||
70 | + }) | ||
71 | +}) | ... | ... |
... | @@ -7,9 +7,14 @@ | ... | @@ -7,9 +7,14 @@ |
7 | <title>Squart Page</title> | 7 | <title>Squart Page</title> |
8 | </head> | 8 | </head> |
9 | <body> | 9 | <body> |
10 | - <div>Teachable Machine Pose Model - Squart</div> | 10 | + <div>온라인 헬스 케어 서비스 (스쿼트)</div> |
11 | +<div> | ||
12 | + <script src = "./squart.js"></script> | ||
13 | + <sapn id = "user_count">0</sapn> | ||
14 | +</div> | ||
11 | <button type="button" onclick="init()">Start</button> | 15 | <button type="button" onclick="init()">Start</button> |
12 | <div><canvas id="canvas"></canvas></div> | 16 | <div><canvas id="canvas"></canvas></div> |
17 | + | ||
13 | <div id="label-container"></div> | 18 | <div id="label-container"></div> |
14 | <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script> | 19 | <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script> |
15 | <script src="https://cdn.jsdelivr.net/npm/@teachablemachine/pose@0.8/dist/teachablemachine-pose.min.js"></script> | 20 | <script src="https://cdn.jsdelivr.net/npm/@teachablemachine/pose@0.8/dist/teachablemachine-pose.min.js"></script> | ... | ... |
views/squartPage/squart.js
0 → 100644
File mode changed
-
Please register or login to post a comment