0.11.1 ā€¢ Published 4 years ago

@roqueando/nous v0.11.1

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

Un orchestre parmi nous. beta.

Install

yarn install
npm install

Usage

const {Manager} = require('@roqueando/nous');
const fs = require('fs');

const manager = new Manager(8080);
manager.run(); // a new server is running in port 8080 waiting for services and messages
console.log('Manager running on 8080');

// for multiple services
const files = fs.readdirSync('./services'); // assuming if services folder is in root path
files.forEach((file) => {
    const service = require(`./services/${file}`);
    const newService = new service();
    newService.setName('nameForService');
    newService.run(); // this will register on Manager and be ready for receive messages.
    console.log(`Running ${newService.name} at ${newService.port}`);
});

// for one service
const service = require('./services/service.js');
const newService = new service();
service.setName('aServiceName');
service.run();

Run tests

yarn test

API

Manager

new Manager a new instance to manager server, which one can receive messages, actions and distribute to all other services

Service

new Service anything that is extended as Service, will be a server with your business logic in TCP or HTTP connection.

Services can communicate with Manager and other services via TCP, and can be HTTP or TCP node.

Router

new Router a router its only for HTTP services, that can up routes and handlers for service like a "express" app.

Client

new Client a client to connect to manager and send actions and receive data. Can be used in front too.

Token

new Token a JWT Token generator.

Authors

šŸ‘¤ roqueando

šŸ‘¤ christopy

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

Show your support

Give a ā­ļø if this project helped you!


This README was generated with ā¤ļø by readme-md-generator

0.11.1

4 years ago

0.11.0

4 years ago

0.10.2

4 years ago

0.10.3

4 years ago

0.10.4

4 years ago

0.9.0

4 years ago

0.8.2

4 years ago

0.7.0

4 years ago

0.5.3

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.2.14

4 years ago

0.2.13

4 years ago

0.2.12

4 years ago

0.2.61

4 years ago

0.2.6

4 years ago

0.2.9

4 years ago

0.2.11

4 years ago

0.2.10

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago