aboutsummaryrefslogtreecommitdiff
path: root/src/login.html
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2019-12-26 20:28:52 -0600
committerMark Powers <markppowers0@gmail.com>2019-12-26 20:28:52 -0600
commit60f66450078b0a3a46d4ab373645c2546aab28f4 (patch)
tree94bc6f8146ca5f861396c454218e6960aa46a45e /src/login.html
initial commit
Diffstat (limited to 'src/login.html')
-rw-r--r--src/login.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/login.html b/src/login.html
new file mode 100644
index 0000000..d1dbe1d
--- /dev/null
+++ b/src/login.html
@@ -0,0 +1,40 @@
+<!doctype html>
+<html lang="en">
+
+<head>
+ <title>Mark's Database - Login</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <link rel="stylesheet" type="text/css" href="/css/styles.css">
+ <script>
+ function sendPost(){
+ let username = document.getElementById('username').value;
+ let password = document.getElementById('password').value;
+ fetch(new Request("/login", {
+ method: 'POST',
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({'username':username, 'password':password})
+ }))
+ .then((response) => {
+ console.log(response);
+ window.location = "/";
+ });
+ }
+ </script>
+</head>
+
+<body>
+ <div>
+ <h1>Login</h1>
+ <div class="form">
+ <input type="text" placeholder="Enter Username" name="username" id="username" required>
+ <input type="password" placeholder="Enter Password" name="password" id="password" required>
+ <button onclick="sendPost()">Log in</button>
+ </div>
+ </div>
+</body>
+
+</html> \ No newline at end of file