-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviews
More file actions
53 lines (46 loc) · 2.05 KB
/
views
File metadata and controls
53 lines (46 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<title>Exercise Tracker | Free Code Camp</title>
<link rel="shortcut icon" href="https://cdn.hyperdev.com/us-east-1%3A52a203ff-088b-420f-81be-45bf559d01b1%2Ffavicon.ico" type="image/x-icon"/>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<script>
/*
function validateForm(data) {
var date = new Date(data);
if(date == "Invalid Date"){
console.log("invalid date");
alert ("Must enter valid date");
return false;
} else {
return true;
}
}
*/
</script>
</head>
<body>
<div class="container">
<h1>Exercise tracker</h1>
<form action="/api/exercise/new-user" method="post">
<h3>Create a New User</h3>
<p><code>POST /api/exercise/new-user</code></p>
<input id="uname" type="text" name="username" placeholder="username">
<input type="submit" value="Submit">
</form>
<form action="/api/exercise/add" method="post" name = "myForm">
<h3>Add exercises</h3>
<p><code>POST /api/exercise/add</code></p>
<input id="uid" type="text" name="userId" placeholder="userId*" required>
<input id="desc" type="text" name="description" placeholder="description*" required>
<input id="dur" type="number" name="duration" placeholder="duration* (mins.)" required>
<input id="dat" type="text" name="date" placeholder="date (yyyy-mm-dd)" required>
<input type="submit" value="Submit">
</form>
<p><strong>GET users's exercise log: </strong><code>GET /api/exercise/log?{userId}[&from][&to][&limit]</code></p>
<p><strong>{ }</strong> = required, <strong>[ ]</strong> = optional</p>
<p><strong>from, to</strong> = dates (yyyy-mm-dd); <strong>limit</strong> = number</p>
</div>
</body>
</html>