removed client
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
FROM nginx:alpine
|
|
||||||
COPY . /usr/share/nginx/html
|
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
services:
|
services:
|
||||||
app:
|
|
||||||
build: .
|
|
||||||
ports:
|
|
||||||
- "8000:80"
|
|
||||||
volumes:
|
|
||||||
- .:/usr/share/nginx/html
|
|
||||||
api:
|
api:
|
||||||
build: ./api
|
build: ./api
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
21
index.html
21
index.html
@@ -1,21 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Average eBay Price</title>
|
|
||||||
<link rel="stylesheet" href="styles/index.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div>
|
|
||||||
<form>
|
|
||||||
<fieldset>
|
|
||||||
<legend>Enter Product Code</legend>
|
|
||||||
<input name="productCode" type="text" id="productCode">
|
|
||||||
<button id="submitProductCode">Submit</button>
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<script src="scripts/index.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
window.addEventListener("load", function () {
|
|
||||||
const form = document.querySelector("form");
|
|
||||||
|
|
||||||
// Function to handle form submission
|
|
||||||
async function handleSubmit(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
// Get the value entered in the input field
|
|
||||||
const productCode = document.getElementById("productCode").value;
|
|
||||||
try {
|
|
||||||
// Send POST request to server
|
|
||||||
const response = await fetch("http://localhost:3000/api/item-lookup", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json", // Indicate that the request body is JSON
|
|
||||||
},
|
|
||||||
body: JSON.stringify({ productCode }),
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(
|
|
||||||
`Network response was not ok, status: ${response.status}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optional: Handle JSON response data here
|
|
||||||
// const data = await response.json();
|
|
||||||
// console.log(data);
|
|
||||||
|
|
||||||
console.log("Data submitted successfully");
|
|
||||||
// Optional: Update UI to reflect success
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error submitting data:", error);
|
|
||||||
// Optional: Update UI to reflect error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add event listener to the form's submit event
|
|
||||||
form.addEventListener("submit", handleSubmit);
|
|
||||||
});
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
body{
|
|
||||||
display: flex;
|
|
||||||
margin: 2rem;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: snow;
|
|
||||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
input{
|
|
||||||
border: solid teal 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:hover{
|
|
||||||
box-shadow: 0 0 2px 2px teal;
|
|
||||||
outline-color: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:focus{
|
|
||||||
box-shadow: 0 0 2px 2px orange;
|
|
||||||
}
|
|
||||||
|
|
||||||
fieldset{
|
|
||||||
box-shadow: 0 0 10px 2px white;
|
|
||||||
border-radius: 4px;
|
|
||||||
color: teal;
|
|
||||||
border: solid teal 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
legend{
|
|
||||||
background-color: snow;
|
|
||||||
}
|
|
||||||
|
|
||||||
button{
|
|
||||||
background-color: teal;
|
|
||||||
color: white;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-weight: 700;
|
|
||||||
cursor: pointer !important;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user