45 lines
No EOL
1.6 KiB
Cheetah
45 lines
No EOL
1.6 KiB
Cheetah
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>{{ .title }}</title>
|
|
{{template "head" .}}
|
|
</head>
|
|
<body>
|
|
{{template "navbar" .}}
|
|
|
|
<div class="position-absolute top-50 start-50 translate-middle">
|
|
<form action="http://localhost:8080/register" method="POST">
|
|
<div class="mb-3">
|
|
<label for="username" class="form-label">Username</label>
|
|
<input type="text" class="form-control" id="username" aria-describedby="emailHelp">
|
|
<div id="emailHelp" class="form-text">The username needs to be unique</div>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="password" class="form-label">Password</label>
|
|
<input type="password" class="form-control" id="password" aria-describedby="passwordHelp">
|
|
<div id="passwordHelp" class="form-text">The password needs to be different from the username</div>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
</form>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
|
|
<script>
|
|
let formData = new FormData();
|
|
formData.append("username", "Florian");
|
|
formData.append("password", "SuperSafe");
|
|
|
|
let requestOptions = {
|
|
method: 'POST',
|
|
body: formData,
|
|
redirect: 'follow'
|
|
};
|
|
|
|
fetch("http://localhost:8080/register", requestOptions)
|
|
.then(response => response.text())
|
|
.then(result => console.log(result))
|
|
.catch(error => console.log('error', error));
|
|
</script>
|
|
</body>
|
|
</html> |