This commit is contained in:
MishaBagger
2023-11-08 13:41:29 +03:00
parent 797df1e4fa
commit 0956275ec4
24 changed files with 4184 additions and 0 deletions

27
21/views/images.html Normal file
View File

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<script>
fetch("/imagelist")
.then((response) => response.json())
.then((imageUrls) => {
const container = document.getElementById("image-container");
imageUrls.forEach((url) => {
const img = document.createElement("img");
img.src = url;
img.width = "200";
img.height = "200";
container.appendChild(img);
const br = document.createElement("br");
container.appendChild(br);
});
});
</script>
</head>
<body>
<h1>Image Gallery</h1>
<div id="image-container"></div>
<button onclick="window.location.href='/'">Back to Home</button>
</body>
</html>

14
21/views/index.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Image Uploader</title>
</head>
<body>
<form method="POST" action="/upload" enctype="multipart/form-data">
<input type="file" name="uploadImg" />
<button type="submit">Upload</button>
</form>
<br />
<button onclick="window.location.href='/images'">Show Images</button>
</body>
</html>