You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- π **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
### 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:
Full guide: [docs/STATIC_API.md](docs/STATIC_API.md). Test locally: `npm run generate:static` then `./scripts/test-static-api.sh [BASE_URL]`.
52
57
53
58
### Option 3: Self-Host on Vercel (5 minutes)
54
59
1.**Fork this repository** on GitHub
@@ -289,9 +294,12 @@ npm run start:dev
289
294
npm run start:dev # Start with hot reload
290
295
npm run build # Build for production
291
296
npm run start:prod # Start production server
297
+
npm run generate:static # Generate static API JSON from data/2025 (output: static-api/api/)
292
298
npm run lint # Run linter
293
299
```
294
300
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
+
295
303
## π Data Statistics
296
304
297
305
**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!
344
352
345
353
-[x]~~Update Data to 2025~~**β DONE** (January 2026)
346
354
-[x]~~Integrate Postal Codes~~**β DONE** (100% coverage)
355
+
-[x]~~Static API on GitHub Pages~~**β DONE** (landing page + JSON API, same response shape)
347
356
-[ ] Add caching layer for improved performance
348
357
-[ ] Add API rate limiting
349
358
@@ -365,9 +374,11 @@ ISC License - See [LICENSE](LICENSE) file
365
374
## π Acknowledgments
366
375
367
376
-**[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
368
378
-**Kementerian Dalam Negeri (Kemendagri)** - Official 2025 data
369
379
-[Supabase](https://supabase.com) for free PostgreSQL hosting
370
380
-[Vercel](https://vercel.com) for free serverless hosting
381
+
-[GitHub Pages](https://pages.github.com) for static API hosting
0 commit comments