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
- Host: GitHub
- URL: https://github.com/herudi/nbroadcast
- Owner: herudi
- Created: 2021-07-18T06:38:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-04T22:36:55.000Z (about 3 years ago)
- Last Synced: 2025-02-28T06:27:12.860Z (over 1 year ago)
- Topics: deno
- Language: HTML
- Homepage: https://nbroadcast.deno.dev
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)
});
```