1.2.9 • Published 4 months ago

kswc v1.2.9

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

  1. Install
npm install kswc
  1. Load
const srvAPI = require('kswc');
  1. Simple example

Common topics

  1. Operations
  2. Configuration
  3. Asynchronous and Synchronous

Advanced topics

  1. Different Service Instances
  2. Authorization
  3. Multi endpoints
  4. Extension

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);

})();
1.2.9

4 months ago

1.2.8

4 months ago

1.2.7

4 months ago

1.2.6

3 years ago

1.2.5

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago