diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-10-09 22:42:56 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-10-09 22:42:56 -0500 |
commit | 0345f90a7baceae507f417abe30736cc95cdc0cf (patch) | |
tree | 8c9617f0a039f2c1cebe33d3ad826bb01a15b482 /src/login.html | |
parent | 35b6d276bdeabdf7bf5eee59d85dfefee7531fce (diff) |
Begin refactor to use server side templates
Diffstat (limited to 'src/login.html')
-rw-r--r-- | src/login.html | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/login.html b/src/login.html deleted file mode 100644 index ec41762..0000000 --- a/src/login.html +++ /dev/null @@ -1,49 +0,0 @@ -<!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> - let usernameEl = document.getElementById('username'); - let passwordEl = document.getElementById('password'); - function sendPost(){ - let username = usernameEl.value; - let password = passwordEl.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 = "/"; - }); - } - let onEnterEvent = function(event) { - if (event.keyCode === 13) { - sendPost() - } - } - usernameEl.addEventListener("keyup", onEnterEvent); - passwordEl.addEventListener("keyup", onEnterEvent); - </script> -</head> - -<body> - <div> - <h1>Login</h1> - <div class="form"> - <input on 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 |