This application demonstrates the use of Server-Sent Events (SSE) using a simple Web-Application developed in Go. The user can start a new deployment by clicking on Start Deployment
on the home page. The application mocks a deployment by creating a new file for each Deployment request and writing randomly generated sentences to the newly generated file in short intervals. Additionally, the server reads the file continuously and streams any updates in the file to the corresponding clients in real-time over an established SSE connection. The client can view the log updates in a scrollable window.
- Go 1.16+
- Make
- Macbook Pro
-
Clone the repository:
git clone https://github.com/yourusername/sse-demo.git cd sse-demo
-
Install dependencies:
go mod tidy
To run the application, use the Makefile:
-
Run the Application:
make run
-
Open your browser and navigate to
http://localhost:8080
. -
Click the "Start Deployment" button to start generating logs. A new tab will open displaying the log updates in real-time.
The log directory should get cleaned up automatically when the application exits. To clean up the log directory manually, use the following command:
make clean