Skip to content

A beginner-friendly example demonstrating how to implement Server-Sent Events (SSE) using Express.js. This project helps developers understand the basics of SSE and how it can be used for real-time data updates in a web application.

Notifications You must be signed in to change notification settings

amdsaad/sse-express-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express SSE Example

A beginner-friendly example demonstrating how to implement Server-Sent Events (SSE) using Express.js. This project helps developers understand the basics of SSE and how it can be used for real-time data updates in a web application.


Features

  • Real-Time Data Updates: Use SSE to send updates from the server to the client without polling.
  • Simple and Lightweight: Built with minimal dependencies to keep things straightforward.
  • Beginner-Friendly: Clean and easy-to-understand codebase with comments.

Installation

Follow these steps to set up and run the project locally:

  1. Clone the repository:

    git clone https://github.com/amdsaad/sse-express-js.git
  2. Navigate to the project directory:

    cd sse-express-js
  3. Install dependencies:

    npm install
  4. Start the server:

    node app.js
  5. Open index.html in your browser to see SSE in action.


Usage

  • The app.js file contains a simple Express server that sends real-time updates to connected clients.
  • Open the index.html file in your browser to establish an SSE connection and receive data updates from the server.

For a detailed explanation of how this application works, refer to this blog post.


Contribution

Contributions are welcome! Here's how you can get involved:

  1. Fork the repository.

  2. Create a new branch for your feature/bugfix:

    git checkout -b feature-name
  3. Make your changes and commit them:

    git commit -m "Add new feature"
  4. Push your changes to your fork:

    git push origin feature-name
  5. Open a pull request.


License

This project is licensed under the MIT License.


Tags/Topics

expressjs sse nodejs backend real-time-updates


Contact

For questions or feedback, feel free to reach out:

About

A beginner-friendly example demonstrating how to implement Server-Sent Events (SSE) using Express.js. This project helps developers understand the basics of SSE and how it can be used for real-time data updates in a web application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published