Skip to content

An example of use of yew-sse

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

dureuill/yew-sse-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yew-sse-example

This repository is a proof of concept of:

  • Serving a yew frontend application from a rocket backend
  • Using the yew-sse library to send messages and receive them from several connected clients.

This example is not meant to be minimal. Rather, it's meant to be fun, and so it uses:

  • The cargo xtask pattern to distribute and serve the frontend application from the backend.
  • trunk to perform the "distribution" step of the frontend
  • clap for ergonomic CLI definition
  • color-eyre for nice, colored errors ✨
  • duct, for easy scripting in Rust

What it does not demonstrate though, is the vastness of my skills at CSS 😛.

How to use

Prerequisites

You'll need Rust installed, with the wasm32-unknown-unknown target available, as well as the trunk tool.

To install trunk, just run:

cargo install trunk

To install the wasm32-unknown-unknown target:

rustup target add wasm32-unknown-unknown

Serving the example

From the repository's root directory, run:

cargo xtask run

(add the --release flag to build everything in --release mode)

After the build, once rocket is started, open http://127.0.0.1:8000 in your browser to use the yew application. Open several times the same page to exchange messages! Very convenient 😅

About

An example of use of yew-sse

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published