0.0.73 • Published 3 years ago

@artlife/micro v0.0.73

Weekly downloads
88
License
MIT
Repository
github
Last release
3 years ago

micro

A tiny and very opinionated microservices framework inspired by expressjs.

This library hosts all the common and boring features shared between our microservices.

WARNING: This library is a work in progress and isn't intended to be general purpose.

Things like:

  • logging
  • basic error handling
  • metrics
  • health checks
  • tracing requests and events across services

Environment variables

Configuration of the microserver can be done via environment variables (if not configure specifically in the code):

  • HOST - Sets the host for the REST API (defaults to 0.0.0.0).
  • PORT - Sets the port number for the REST API (defaults to 3000).
  • MESSAGING_HOST - Sets the connection to the RabbitMQ server (defaults to amqp://guest:guest@localhost:5672).
  • NODE_ENV - When set to PRODUCTION Morgan request tracing is disabled.
  • ENABLE_MORGAN - When set to "true" Morgan request tracing is enabled (can be used to enable request tracing in production).

Installation

npm install --save @artlife/micro

Example Usage

For an example use, please see the template microservice:

https://github.com/artlife-solutions/template-microservice

Building the code

Open folder in Visual Studio Code and hit Ctrl+Shift+B

Or run

npm run build

Or

npx tsc

Tests

Run

npm test

Or

npm run test:watch

Or

npx mocha --opts ./src/test/mocha.opts

Or

npx mocha --watch --watch-extensions ts --opts ./src/test/mocha.opts

Debugging

Debugging the command line app

  • Open in Visual Studio Code.
  • Select 'Main' debug configuration.
  • Set your breakpoints.
  • Hit F5 to run.

Debugging the tests

  • Open in Visual Studio Code.
  • Select 'Mocha' debug configuration.
  • Open the test source file to execute.
  • Set your breakpoints.
  • Hit F5 to run.
0.0.73

3 years ago

0.0.72

4 years ago

0.0.71

4 years ago

0.0.70

4 years ago

0.0.69

4 years ago

0.0.68

4 years ago

0.0.67

4 years ago

0.0.66

4 years ago

0.0.65

4 years ago

0.0.64

4 years ago

0.0.63

4 years ago

0.0.62

5 years ago

0.0.61

5 years ago

0.0.60

5 years ago

0.0.59

5 years ago

0.0.58

5 years ago

0.0.57

5 years ago

0.0.56

5 years ago

0.0.55

5 years ago

0.0.54

5 years ago

0.0.53

5 years ago

0.0.52

5 years ago

0.0.51

5 years ago

0.0.50

5 years ago

0.0.48

5 years ago

0.0.47

5 years ago

0.0.46

5 years ago

0.0.45

5 years ago

0.0.44

5 years ago

0.0.43

5 years ago

0.0.42

5 years ago

0.0.41

5 years ago

0.0.40

5 years ago

0.0.39

5 years ago

0.0.38

5 years ago

0.0.37

5 years ago

0.0.36

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago

0.0.32

5 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.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

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

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

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

6 years ago