Skip to content

Commit 317064a

Browse files
committed
update readme
1 parent c8c5bd1 commit 317064a

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## 2026-01-30
11+
12+
### Added
13+
- πŸ“„ **Static API on GitHub Pages** – Same data as JSON files, no backend required:
14+
- Generator script: `scripts/generate-static-api.js` (reads `data/2025/` CSVs, outputs `static-api/api/`)
15+
- Response shape matches main API: `{ data, meta }` for lists, single object for detail
16+
- Endpoints: `api/provinces.json`, `api/province/{code}.json`, `api/regencies/{provinceCode}.json`, `api/regency/{code}.json`, `api/districts/{regencyCode}.json`, `api/district/{code}.json`, `api/villages/{districtCode}.json`, `api/village/{code}.json`
17+
- 🌐 **Landing page on GitHub Pages** – Root URL serves the same landing page as Vercel; when served from `*.github.io`, demos and playground use the same-origin static API
18+
- πŸ€– **GitHub Actions workflow** – `Deploy Static API to GitHub Pages` (push to `main` or manual): generates static API, copies `public/index.html` to output, deploys to GitHub Pages (Source: GitHub Actions)
19+
- πŸ“œ **npm script** – `npm run generate:static` to generate static API locally
20+
- πŸ§ͺ **Test script** – `scripts/test-static-api.sh [BASE_URL]` to test all static API endpoints with curl
21+
- πŸ“– **Documentation** – [docs/STATIC_API.md](docs/STATIC_API.md) for fork-and-host steps and endpoint reference
22+
23+
### Changed
24+
- **README** – Option 2 (Static API) now describes landing page + API URLs, feature bullet for static API, `generate:static` and test script in Available Scripts, roadmap item checked, acknowledgments for api-wilayah-indonesia and GitHub Pages
25+
26+
---
27+
1028
## 2026-01-24
1129

1230
### πŸŽ‰ Major Update: 2025 Government Data

β€ŽREADME.mdβ€Ž

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- πŸ”„ **Backward Compatible** - Drop-in replacement for legacy API
3131
- πŸ“¦ **Self-Hostable** - Deploy to your own Vercel account
3232
- πŸ”€ **Advanced Features** - Sorting, pagination, and legacy aliases support
33+
- πŸ“„ **Static API** - Same data as JSON files for GitHub Pages (no backend)
3334

3435
## πŸš€ Quick Start
3536

@@ -48,7 +49,11 @@ curl https://konoland-api.vercel.app/province?name=Jawa
4849
```
4950

5051
### Option 2: Static API on GitHub Pages (no backend)
51-
Same data as JSON files you can host on GitHub Pages. **Fork** β†’ **Settings β†’ Pages β†’ Source: GitHub Actions** β†’ push to `main` (or run the "Deploy Static API to GitHub Pages" workflow). Your API: `https://<username>.github.io/<repo>/api/provinces.json`. Full guide: [docs/STATIC_API.md](docs/STATIC_API.md).
52+
Same data as static JSON files you can host on GitHub Pagesβ€”no database or server required. **Fork** β†’ **Settings β†’ Pages β†’ Source: GitHub Actions** β†’ push to `main` (or run the "Deploy Static API to GitHub Pages" workflow). You get:
53+
- **Landing page**: `https://<username>.github.io/<repo>/`
54+
- **Static API**: `https://<username>.github.io/<repo>/api/` (e.g. `.../api/provinces.json`)
55+
56+
Full guide: [docs/STATIC_API.md](docs/STATIC_API.md). Test locally: `npm run generate:static` then `./scripts/test-static-api.sh [BASE_URL]`.
5257

5358
### Option 3: Self-Host on Vercel (5 minutes)
5459
1. **Fork this repository** on GitHub
@@ -289,9 +294,12 @@ npm run start:dev
289294
npm run start:dev # Start with hot reload
290295
npm run build # Build for production
291296
npm run start:prod # Start production server
297+
npm run generate:static # Generate static API JSON from data/2025 (output: static-api/api/)
292298
npm run lint # Run linter
293299
```
294300

301+
To test the static API locally after generating: `./scripts/test-static-api.sh` (optional base URL: `./scripts/test-static-api.sh https://leonurium.github.io/konoland-api/api`).
302+
295303
## πŸ“Š Data Statistics
296304

297305
**2025 Data** (Kepmendagri No 300.2.2-2138 Tahun 2025):
@@ -344,6 +352,7 @@ Existing applications can switch to this API without any code changes!
344352

345353
- [x] ~~Update Data to 2025~~ **βœ… DONE** (January 2026)
346354
- [x] ~~Integrate Postal Codes~~ **βœ… DONE** (100% coverage)
355+
- [x] ~~Static API on GitHub Pages~~ **βœ… DONE** (landing page + JSON API, same response shape)
347356
- [ ] Add caching layer for improved performance
348357
- [ ] Add API rate limiting
349358

@@ -365,9 +374,11 @@ ISC License - See [LICENSE](LICENSE) file
365374
## πŸ™ Acknowledgments
366375

367376
- **[Wilayah Nusantara API](https://github.com/theodevoid/wilayah-nusantara)** by [@theodevoid](https://github.com/theodevoid) - Original inspiration
377+
- **[api-wilayah-indonesia](https://github.com/emsifa/api-wilayah-indonesia)** by [@emsifa](https://github.com/emsifa) - Inspiration for static API on GitHub Pages
368378
- **Kementerian Dalam Negeri (Kemendagri)** - Official 2025 data
369379
- [Supabase](https://supabase.com) for free PostgreSQL hosting
370380
- [Vercel](https://vercel.com) for free serverless hosting
381+
- [GitHub Pages](https://pages.github.com) for static API hosting
371382

372383
## πŸ“ž Support
373384

0 commit comments

Comments
Β (0)