sveltekit-zero-api
v0.15.8
Published
Provides type-safety between front- and backend of your SvelteKit project
Downloads
215
Maintainers
Readme
Quick Start
// vite.config.ts
import { zeroAPI } from 'sveltekit-zero-api'
const config: UserConfig = {
plugins: [
sveltekit(),
zeroAPI()
]
}
// .gitignore
**/sveltekit-zero-api.d.ts
- Body and query is typed seemlessly in both frontend, and endpoints
- Queries are easier to use with querySpread which supports objects as query parameters
- Endpoint routes are automatically typed
- Generic endpoints
- Typed endpoint pipeline
- The returned content of endpoints are typed
- Supports slugged routes
- Can be used in the page
Load
function - You can type-define variables with endpoint responses
- Has handy backend utility functions; querySpread and Error Handling
Acknowledgments
Thank you ymzuiku for igniting the initial concept and codebase svelte-zero-api. And naturally, a big thanks to the Vite and Svelte family for the worlds best framework!💘