This sample application is written in Ionic6 (Angular) on the client side and rust-lang.org (rust edition 2021) on the server side.
It's a demonstration of how to use Angular and websocket for a web chat. Everything the client writes to the websocket, the server echoes back (see developer console in the browser).
- Server uses actix
- Install Rust
cd rustServer
- Compile using the command
cargo build
- Run using the command
cargo run
cd rustServer
cargo build
cargo run
- Install Ionic Framework (Node Ionic)
cd chatApp
- npm install
- Run using command
ionic serve
cd chatApp
npm install
ionic serve
Link HERE
- npm outdated
- npm update (all minor packages respecting
packacge.json
version constraints)
npm outdated
npm update
- Client connect automatically if server is detected.
Angular is running in development mode. Call enableProdMode() to enable production mode. core.mjs:25858:16
Sending to websocket:
Object { author: "Author, NEW data here.", message: "NEW message from Author here." } tab1.page.ts:44:12
message received: [object Object] tab1.page.ts:24:16
ServerResponse author.: Author, NEW data here. tab1.page.ts:25:16
ServerResponse message: NEW message from Author here. tab1.page.ts:26:16