# @eyecone/blastmedia-service

> ---

Latest version **1.1.1** (published 2016-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @eyecone/blastmedia-service
pnpm add @eyecone/blastmedia-service
yarn add @eyecone/blastmedia-service
bun add @eyecone/blastmedia-service
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-09-30 |
| First published | 2016-09-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Maintainers | eyecone |

## Links

- npm: https://www.npmjs.com/package/@eyecone/blastmedia-service
- npm.io page: https://npm.io/package/@eyecone/blastmedia-service

## Dependencies (4)

- [express](https://npm.io/package/express.md) ^4.14.0
- [body-parser](https://npm.io/package/body-parser.md) ^1.15.2
- [babel-preset-latest](https://npm.io/package/babel-preset-latest.md) ^6.14.0
- [@eyecone/blastmedia-registry](https://npm.io/package/@eyecone/blastmedia-registry.md) ^1.0.1

## Recent versions

- 1.1.1 (latest) — 2016-09-30
- 1.1.0 — 2016-09-27
- 1.0.2 — 2016-09-26
- 1.0.1 — 2016-09-26
- 1.0.0 — 2016-09-26

## README

## Service
#### Module
---

Allows to connect to the shared configuration and expose methods though various gateways.

### Services
A service *(when used with this module)* is a node instance (or multiple instances) dedicated to perform tasks related to a defined domain.

eg. Image processing, Video processing, Customer data, Presentational tasks

A service can be splitted into multiple services if it handles too many tasks.
***

**Service class:**

Methods:
- constructor(serviceName[, opts])
  - opts:
    - hostname: `String` (service1.domain.com)
    - port: `Int` (3003)
    - publicUrl: `String` (nwsr.eu)
- toJSON(): return an `Object` with name, hostname, port, uptime (in seconds)
- setPublicUrl()
- setDefaultHTTPBanner([path])
  - path: String (default to `/_banner`)
- useGateway(Gateway)
  - Gateway: `Gateway` extended object
- register([hostname[, port[, infos]]])
  - hostname: `String` (default to constructor arg)
  - port: `Int` (default to constructor arg)
  - infos: `Object` (default to constructor created serviceInfos)
- start([hostname[, port[, serviceInfos]]])
  - Starts the gatway and call `register()` with specified args.

Properties:
- gateway: returns the `Gateway` object.
- config: `Object`
  - hostname
  - port
  - serviceInfos
- registry: returns the `Registry` object (likely to be the Etcd wrapper)
- hostname: returns config.hostname
- port: returns config.port
- serviceInfos: returns config.serviceInfos
- uptime
- **static** HTTP_GATEWAY: returns the `HTTPGateway` class (extends `Gateway`)

Exports:
- `Service`
- `RemoteService`

**RemoteService class:**

This class dynamically generate methods based upon the methods exposed by the remote service.

***// @TODO: Write doc about this black magic stuff.***

---

### Gateways
A gateway is a way to connect to the service. A service can have multiple gateways.
***

**Gateways available:**
- HTTP
  - Uses Express express internally.
- gRPC *(not yet implemented)*
  - Uses gRPC to provide a gateway using HTTP/2.

---

### Registry
***// @TODO: Write doc about this awesome stuff.***

---
_Source: https://npm.io/package/@eyecone/blastmedia-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
