e-exchange

command module
v0.0.0-...-31fac03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

SSE Example: Real-time Exchange Rate Updates

This example demonstrates how to use SSE to provide real-time updates of exchange rates. The server randomly generates new exchange rates and sends them to connected clients.

# How to Run?

  • Install Go on your computer.
  • Run the main.go file with Go: go run main.go
  • Open the index.html file in a web browser.

What it Does?

The server sends an SSE event containing randomly updated exchange rates every 5 seconds. JavaScript uses the EventSource API to listen for events sent by the server. Each time a new event is received, the exchange rates are updated in the browser.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL