kswc
v1.2.9
Published
Library to make your Web API deployment easier
Downloads
71
Maintainers
Readme
KsWc is a simple library to make your Web API deployment easier, with it you can operate with REST API as a local library in your project, focused on the CRUD pattern implemented by RESTful services, and support of different automated authentication flows.
This library belong to the Ksike ecosystem:
- KsMf - Microframework (WEB, REST API, CLI, Proxy, etc)
- Ksdp - Design Patterns Library (GoF, GRASP, IoC, DI, etc)
- KsCryp - Cryptographic Library (RSA, JWT, x509, HEX, Base64, Hash, etc)
- KsHook - Event Driven Library
- KsEval - Expression Evaluator Library
- KsWC - Web API deployment Library
Get started
- Install
npm install kswc
- Load
const srvAPI = require('kswc');
Common topics
Advanced topics
Example
(async function(data){
const service = require('kswc');
service.set({
url: 'https://api.domain',
end: '/api/service',
key: 'MTYyOTQ5NjMxMDIDMwM24MDAwNjkzMjQ2NQ==',
});
data = await service.list();
for(let item of data){
console.log('<<', item.name);
}
data = await service.select('3kmkskw1x8o');
data = await service.insert({ name: "Juan" });
data = await service.update({ name: "Mary" }, '3kmkskw1x8o');
data = await service.delete('3kmkskw1x8o');
console.log('>>', data);
})();