cizo
v0.1.0
Published
REST API Integration made easy
Downloads
1
Readme
REST API Integration made easy
🏠 Homepage
Install
npm install cizo
Ideology
This library aims to simplify how client side applications interects with backend REST APIs. Cizo uses object oriented approach to interect with REST API.
Quick Start
server-side
On the Server side you will have to open a public end-point at /_cizo-schema
(however, you can custumize this on client-side). This open endpoint should send JSON Schema something like this:
{
"version": "0.1.0",
"endpoints": [
{
"path": "/hello-world",
"name": "HelloWorld",
"methods": "any"
},
{
"path": "/other",
"name": "other",
"methods": ["GET", "POST"]
}
]
}
client-side
import CizoClient from 'cizo';
const cizo = new CizoClient({
host: 'http://localhost:3000', // default
endpoint: '/_cizo-schema' // default
})
await cizo.init() // this is required to fetch schema
// Performing a query
cizo.get('HelloWorld').then(console.log).catch((error)=>{
console.error("Error", error)
})
Author
👤 Henil Malaviya
- E-mail: [email protected]
- Website: henil.xyz
- Twitter: @realhenil
- Github: @henil0604
🤝 Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!