Initial import
This commit is contained in:
commit
3f6848eb10
19
app.js
Normal file
19
app.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
(function () {
|
||||||
|
var statusEl = document.getElementById("status");
|
||||||
|
var metaEl = document.getElementById("meta");
|
||||||
|
var btn = document.getElementById("action");
|
||||||
|
|
||||||
|
if (!statusEl || !metaEl || !btn) {
|
||||||
|
throw new Error("Missing required DOM elements.");
|
||||||
|
}
|
||||||
|
|
||||||
|
var now = new Date();
|
||||||
|
statusEl.textContent = "Status: JavaScript loaded.";
|
||||||
|
metaEl.textContent = "Loaded at " + now.toISOString();
|
||||||
|
|
||||||
|
btn.addEventListener("click", function () {
|
||||||
|
var clicks = Number(btn.getAttribute("data-clicks") || "0") + 1;
|
||||||
|
btn.setAttribute("data-clicks", String(clicks));
|
||||||
|
btn.textContent = "Clicked " + clicks + (clicks === 1 ? " time" : " times");
|
||||||
|
});
|
||||||
|
})();
|
||||||
70
index.html
Normal file
70
index.html
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>Zip Import Test</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
margin: 40px;
|
||||||
|
color: #1f2933;
|
||||||
|
}
|
||||||
|
.card {
|
||||||
|
max-width: 640px;
|
||||||
|
padding: 24px;
|
||||||
|
border: 1px solid #e5e7eb;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: #ffffff;
|
||||||
|
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
.badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: #e0f2fe;
|
||||||
|
color: #0369a1;
|
||||||
|
font-size: 12px;
|
||||||
|
letter-spacing: 0.03em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.meta {
|
||||||
|
margin-top: 16px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #64748b;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
margin-top: 12px;
|
||||||
|
padding: 10px 14px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #1d4ed8;
|
||||||
|
color: white;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
button:hover {
|
||||||
|
background: #1e40af;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="card">
|
||||||
|
<span class="badge">Zip Import</span>
|
||||||
|
<h1>It works.</h1>
|
||||||
|
<p>This page is served from a ZIP import test project.</p>
|
||||||
|
<p id="status">Status: waiting for JS...</p>
|
||||||
|
<button id="action">Click me</button>
|
||||||
|
<div class="meta" id="meta"></div>
|
||||||
|
</div>
|
||||||
|
<script src="./app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
13
package.json
Normal file
13
package.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "zip-import-test",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"description": "Minimal Node app for ZIP import testing.",
|
||||||
|
"main": "server.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node server.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"express": "^4.18.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
20
server.js
Normal file
20
server.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
const path = require("path");
|
||||||
|
const express = require("express");
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
const port = Number(process.env.FRONT_PORT || process.env.PORT || 3000);
|
||||||
|
const rootDir = __dirname;
|
||||||
|
|
||||||
|
app.use(express.static(rootDir));
|
||||||
|
|
||||||
|
app.get("/health", function (_req, res) {
|
||||||
|
res.status(200).send("ok");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/", function (_req, res) {
|
||||||
|
res.sendFile(path.join(rootDir, "index.html"));
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(port, function () {
|
||||||
|
console.log("zip-import-test listening on port", port);
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user