Visitar URL original
GitHub - is2ei/moleculer-typetalk: Moleculer addon that posts message to Typetalk. · GitHub
Skip to content

About

Moleculer addon that posts message to Typetalk.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

52 Commits

Folders and files

Repository files navigation

Moleculer logo

moleculer-typetalk

Build Status Coverage Status npm version

Install

$ npm i --save moleculer-typetalk

Usage

const {ServiceBroker} = require("moleculer"),
    TypetalkService = require("moleculer-typetalk"),
    config = require("./config");

// Create broker
const broker = new ServiceBroker({logger: console});

// Load my service
broker.createService({
    mixins: [TypetalkService],
    name: "typetalk",
    settings: {
        token: config.token,
        topicID: config.topicID
    }
});

// Start server
broker.start().then(() => {
    broker
        .call("typetalk.post", {
            message: "Hello, Typetalk!"
        })
        .then(() => {
            // Do something...
        })
        .catch(() => {
            // Do something...
        });
});

For working example, see this repository.

Settings

Property Type Default Description
token String required Typetalk token.
topicID String required Topic ID to post to.

About

Moleculer addon that posts message to Typetalk.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages