-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
26 lines (24 loc) · 952 Bytes
/
index.html
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
<html>
<head>
<!--script src="ky.min.js"></script -->
<script type="module">
import ky from 'https://unpkg.com/[email protected]/index.js';
const login = async () => {
const json = {
username: document.querySelector('#username').value,
psswrd: document.querySelector('#psswrd').value
};
//https://test-money-g4q6tqkjza-uc.a.run.app
const parsed = await ky.post('http://localhost:1234/money/login', {json}).json();
document.querySelector('#result').innerHTML = parsed;
};
window.login = login;
</script>
</head>
<body>
Username: <input type="text" id="username" /><br />
Password: <input type="password" id="psswrd" /><br />
<button onclick="login()">Login</button>
<span id="result"></span>
</body>
</html>