rust-web/public/index.html
2021-12-15 14:19:06 -04:00

39 lines
No EOL
1.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.classless.min.css">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Simple client for rust actix back end">
<title>Rust client</title>
</head>
<body>
<main>
<h1>Rust client</h1>
<pre id="result">
hi
</pre>
</main>
</body>
<script>
const consoleSignatureStyle = "font-size: 16px;" +
"background: linear-gradient(to right, #e66465, #9198e5);" +
"color: white;" +
"text-align: center;" +
"padding: 10px 15px;" +
"width: 100%;" +
"border-radius: 20px;";
const welcomeMessage = "Welcome to Rust client ⚙️"
console.log(`%c ${welcomeMessage}`, consoleSignatureStyle)
let data = document.querySelector("#result")
fetch("http://localhost:8000/")
.then(res => res.json())
.then(json => data.innerHTML = JSON.stringify(json, null, 2))
</script>
</html>