feat: add minimal frontend and backend CI demo
This commit is contained in:
35
fe/index.html
Normal file
35
fe/index.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>FE / BE CI demo</title>
|
||||
<style>
|
||||
body { margin: 0; padding: 3rem 1.25rem; color: #172033; background: #f4f7fb; font: 16px/1.5 system-ui, sans-serif; }
|
||||
main { max-width: 38rem; margin: auto; padding: 2rem; border: 1px solid #dbe3ef; border-radius: 1rem; background: white; box-shadow: 0 12px 32px #17203312; }
|
||||
button { padding: .65rem 1rem; border: 0; border-radius: .5rem; color: white; background: #2458d3; font: inherit; cursor: pointer; }
|
||||
pre { min-height: 3rem; padding: 1rem; overflow-wrap: anywhere; border-radius: .5rem; background: #f4f7fb; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Frontend is running</h1>
|
||||
<p>This page is served by the <code>fe</code> service.</p>
|
||||
<button id="check-backend" type="button">Call backend</button>
|
||||
<pre id="result" aria-live="polite">Click the button to call the backend.</pre>
|
||||
</main>
|
||||
<script>
|
||||
const button = document.querySelector("#check-backend");
|
||||
const result = document.querySelector("#result");
|
||||
button.addEventListener("click", async () => {
|
||||
result.textContent = "Calling backend…";
|
||||
try {
|
||||
const response = await fetch("/api/hello");
|
||||
result.textContent = JSON.stringify(await response.json(), null, 2);
|
||||
} catch {
|
||||
result.textContent = "Could not reach the backend.";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user