0.0.2 • Published 4 years ago

apio-utils v0.0.2

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

Contents Table

Introduction

What is Apio ? 🤔 Apio is a powerful library to create easly any type of api, in a few minutes. Made in TypeScript, Apio is easily usable in any context of JavaScript, in TypeScript web, node.js web, classic node.js, or classic javascript! Install, import, create. That's easy.

Usage

TypeScript :

import { Something... } from 'apio-utils';

NodeJS :

const { Something... } = require('apio-utils');

Client

Object Client is the client api.

ParameterTypeDescription
configClientConfigThe configuration of the client

TypeScript :

import { Client, ClientConfig } from 'apio-utils';

const config: ClientConfig = new ClientConfig({ port: 1000 });
const client: Client = new Client(config);

JavaScript :

const { Client, ClientConfig } = require('apio-utils');

const config = new ClientConfig({ port: 1000 });
const client = new Client(config);

.call(key: string, ...args?: any)

Call a request on the server.

  • key : string *
  • ...args : any

Server

Object Server is the server api.

ParameterTypeDescription
configClientConfigThe configuration of the server
authContextAuthentification?The authentification context of the server

TypeScript :

import { Server, ServerConfig } from 'apio-utils';

const config: ServerConfig = new ServerConfig({ port: 1000 });
const server: Server = new Server(config);

JavaScript :

const { Server, ServerConfig } = require('apio-utils');

const config = new ServerConfig({ port: 1000 });
const server = new Server(config);

.register(...req: Request)

Register a request in the server.

  • ...req : Request *

.unregister(...req: Request)

Unregister a request in the server.

  • ...req : Request *

.users: User[]

Return array of connected users.


Our Future

In writing.