Build a job board that lists the latest job postings from a Hacker News-style API.
api.js is a mock that stands in for the real Hacker News endpoints:
| Mock | Real endpoint |
|---|---|
fetchJobIds() → Promise<number[]> | GET /v0/jobstories.json (newest first) |
fetchJob(id) → Promise<{ id, by, title, time, url? }> | GET /v0/item/<id>.json |
The real API differs in that you call fetch, check response.ok, parse JSON, and may get null for deleted items. time is in Unix seconds. The mock has 15 jobs, and some have no url. Set mockOptions.failIds / failItems to simulate failures.
url (opening in a new tab) when there is one, or as plain text when there isn'tBy <author> · <date>, with the date formatted for the user's locale from timeLoading… and is disabled. Hide it when there are no more jobs.role="alert") with a Retry button that repeats the failed step.<ul>/<li>) of <article>s. External links say they open in a new tab.Loaded 6 more jobs. Keyboard focus must not jump.jobstories.json returns ~200 ids. What if you need search or filters?null. How should pagination handle that?Spotted a mistake or a rights concern? Report an issue