fix(core): update

This commit is contained in:
Philipp Kunz 2019-04-11 18:31:21 +02:00
parent 6dd3782b0d
commit 430c3ea13a
2 changed files with 9 additions and 4 deletions

View File

@ -20,6 +20,10 @@ messaging service for micro services
Use TypeScript for best in class instellisense.
### What does smartuniverse all about?
Think WhatsApp, but for your microservices architecture. It allows your services to securely talk to each other in private, shielded channels without having to expose anything to the outside world. This allows the use of reactive programming across your entire stack.
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)

View File

@ -32,17 +32,18 @@ export class ClientUniverse {
}
public async sendMessage(messageArg, payloadArg) {
const requestBody = {
const requestBody: interfaces.IUniverseMessage = {
message: messageArg,
payload: payloadArg
};
const requestBodyString = JSON.stringify(requestBody);
// TODO: User websocket connection if available
await plugins.smartrequest.postJson(this.options.serverAddress, {
requestBody
const response = await plugins.smartrequest.postJson(`${this.options.serverAddress}/sendmessage` , {
requestBody: requestBodyString
});
}
public async getChannel(channelName: string): Promise<ClientUniverseChannel> {
public async getChannel(channelName: string, passphrase): Promise<ClientUniverseChannel> {
await this.checkConnection();
const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel(
this,