REST API Integration made easy
๐ Homepage
npm install cizo
This library aims to simplify how client side applications interects with backend REST APIs. Cizo uses object oriented approach to interect with REST API.
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)
})
๐ค Henil Malaviya
- E-mail: [email protected]
- Website: henil.xyz
- Twitter: @realhenil
- Github: @henil0604
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a โญ๏ธ if this project helped you!