https://github.com/artcom/service-init
https://github.com/artcom/service-init
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/artcom/service-init
- Owner: artcom
- Created: 2016-08-25T07:43:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-03-26T12:51:06.000Z (about 7 years ago)
- Last Synced: 2025-01-27T14:18:51.142Z (over 1 year ago)
- Language: TypeScript
- Size: 136 KB
- Stars: 0
- Watchers: 23
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Service Init
Wraps the initialization tasks of a backend service.
## Features
* A [bunyan](https://www.npmjs.com/package/bunyan) logger
* MQTT client connection via [mqtt-topping](https://www.npmjs.com/package/mqtt-topping)
* A config query method which
* Bootstrap parameter returned by a query of a given uri with retries
## Usage
```javascript
var init = require("service-init");
var serviceId = "myService";
var bootstrapUri = "http://bootstrap-server.com/myService"; // process.env is used for bootstrapping if null
init(serviceId, bootstrapUri, (log, mqttClient, queryConfig, bootstrapData) => {
// application logic goes here
});
```