An open API service indexing awesome lists of open source software.

https://github.com/herudi/nbroadcast

Crazy fast broadcast message
https://github.com/herudi/nbroadcast

deno

Last synced: 11 months ago
JSON representation

Crazy fast broadcast message

Awesome Lists containing this project

README

          

# NBroadcast
Crazy fast broadcast message.
[Example Site](https://nbroadcast.deno.dev/sample/live-news)

## Usage listen message
```js
const evtSource = new EventSource("https://nbroadcast.deno.dev//");
evtSource.onmessage = function (event) {
const data = JSON.parse(event.data);
console.log(data)
}
```

## Usage send message
```js
fetch("https://nbroadcast.deno.dev//", {
method: "POST",
body: JSON.stringify(yourdata)
})
.then(data => data.json)
.then((data) => {
console.log(data)
})
.catch((err) => {
console.log(err)
});
```