0.1.5 • Published 28 days ago

@baristaio/espresso v0.1.5

Weekly downloads
45
License
MIT
Repository
github
Last release
28 days ago

IN DEVELOPMENT: PLEASE DON'T USE

espresso

The micro service wrapper

The espresso is a NodeJS service wrapper for controllers.

This service provides following goodies:

  • access validation JWT based
  • context log
  • service log
  • connections
    • Redis
    • Mongo
    • Neo4J
    • Other
  • controllers routing
  • registration in service manager - Barista

Release

0.1.0 upgrade redis client to version 4.x.x

Install

npm i

API

ServiceDescriptor

  • Service name
  • config
  • routes

Espresso API

  • register (serviceDescriptor): registration the service in Barista
    • registration running after installation
  • createInstance(ServiceDescriptor) -> create the service instance with:
    • logger
    • db connection pool

  • isAvailable: return status

Service API

  • Service properties
    • token (JWT): received from Barista
      • service name
      • env (environment)
      • instance ID

    • start:
      • mode: (test, local, debug, prod) return status
    • stop
    • routes: { route: "route", controller: "controller" }

    • persistence

      • getClient
        • Mongo
        • Redis
        • Neo4J

Controller API

ControllerDescriptor

{
    "name": "string",
    "route": "string",
    "req": "request",
    "res": "response",
    "next": "next" ,
    "callback": "function",
    "connections": ["mongoClient", "redisClient", "etc"]
}

Resources

Resources = { Mongo, Mongoose, Redis, NeoJ4 }

  • getResource(Resources.Mongo)

Examples

const espresso = required('espresso');
const controller = required('./controllers/<your controller>');

const service = espresso.getService({
    name: 'myService',
});

service.start();

service.stop('reason');

for run example please use node parameters: -r babel-register:

npm i

cd example

node -r babel-register simple.js

the service will stoped after 1 minute.

0.1.4

28 days ago

0.1.3

28 days ago

0.1.5

28 days ago

1.0.0-alfa

7 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.48

1 year ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.40

2 years ago

0.0.39

2 years ago

0.0.37

3 years ago

0.0.38

2 years ago

0.0.36

3 years ago

0.0.35

3 years ago

0.0.34

3 years ago

0.0.33

3 years ago

0.0.31

3 years ago

0.0.30

4 years ago

0.0.29

4 years ago

0.0.28

4 years ago

0.0.25

4 years ago

0.0.26

4 years ago

0.0.27

4 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

6 years ago