0.1.10 • Published 9 months ago

@baristaio/espresso v0.1.10

Weekly downloads
45
License
MIT
Repository
github
Last release
9 months 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.10

9 months ago

0.1.8

9 months ago

0.1.9

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.5

1 year ago

1.0.0-alfa

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.48

2 years ago

0.0.41

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.40

3 years ago

0.0.39

4 years ago

0.0.37

4 years ago

0.0.38

4 years ago

0.0.36

4 years ago

0.0.35

4 years ago

0.0.34

4 years ago

0.0.33

4 years ago

0.0.31

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.25

5 years ago

0.0.26

5 years ago

0.0.27

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

7 years ago