vite-plugin-static-json-api
v1.0.4
Published
Transform a single JSON configuration into a complete static API that works with any static hosting provider
Maintainers
Readme
Project: vite-plugin-static-json-api
Transform a single JSON configuration into a complete static API that works with any static hosting provider.
Static JSON API is a build tool that converts your API routes and data from a single json-api.json file into individual static JSON files, making it possible to serve API-like responses from static hosting services like GitHub Pages, Netlify, or Cloudflare Pages.
Key Features
- 📁 Single config file - Define all your API routes and data in one place
- 🚀 Static hosting ready - Generated files work with any static host
- 🌳 Nested routes - Support for complex route hierarchies
- ⚡ Zero runtime - No server required, just serve static files
- 🛠️ CLI & programmatic - Use via command line or integrate into your build process
- 📦 TypeScript support - Full type safety included
Quick Start
- Create your
static-json-api.jsonconfiguration - Run ``
- Deploy the generated
dist/folder to any static host
Perfect for JAMstack applications, prototyping APIs, serving mock data, or creating lightweight backends without server infrastructure.
Example Output
Your routes like /auth/login and /questions become static files at auth/login/index.json and questions/index.json, accessible via standard HTTP requests to your static site.
