diff --git a/README.md b/README.md index 078a172..7447334 100644 --- a/README.md +++ b/README.md @@ -30,5 +30,6 @@ Source: https://www.programmfabrik.de/en/assignment-frontend-backend-developer-j * ~0.5 hours to set up the project; * ~5 hours to implement game board serialization, tic-tac-toe rules and game solver (with tests); -* ~1 hour to set up the backend / frontend structure with JSX templating and static resources +* ~1 hour to set up the backend / frontend structure with JSX templating and static resources; +* ~2 hours to implement progressively enhanced form and query string value trackers (both on backend and in web components); * ... diff --git a/src/backend/main.tsx b/src/backend/main.tsx index ab4727b..e76d7f4 100644 --- a/src/backend/main.tsx +++ b/src/backend/main.tsx @@ -2,8 +2,10 @@ import type { RequestHandler } from "express"; import { safeGetQueryValue, sendHtml } from "./utils.ts"; export const mainPageHandler: RequestHandler = (req, res) => { - const a = parseInt(safeGetQueryValue(req, "a") ?? "0", 10); - const b = parseInt(safeGetQueryValue(req, "b") ?? "0", 10); + const counters = { + a: parseInt(safeGetQueryValue(req, "a") ?? "0", 10), + b: parseInt(safeGetQueryValue(req, "b") ?? "0", 10), + }; sendHtml( res, @@ -13,34 +15,51 @@ export const mainPageHandler: RequestHandler = (req, res) => { because we're loading the compiled file on frontend, from path relative to the root page, and because TS won't rewrite the extension here. */} - +
Hello world!
-