News Search App
A vanilla-JS front end searching live news via the GNews API.
project→ source
tech:
README
News Search App
A small vanilla JS front end that searches live news via the GNews REST API.
What it does
A single search box fetches matching articles from GNews and renders them as cards (title, source, snippet, link). Handles three states explicitly: default/empty landing content, no-results, and populated results.
Stack
HTML, CSS, vanilla JavaScript (fetch), no build step, no framework.
Running it
- Get a free API key at gnews.io
- Open
homescript.jsand setapiKeynear the top ofsearchNews() - Open
home.htmlin a browser
Note
The original version of this had a live API key committed directly in the source — that key has been removed and the field left blank. Never commit API keys; use an environment variable or a build-time secret for anything beyond a toy front-end project like this.