Skip to content

idirnaitali/chat-app-with-angular-and-web-socket

Repository files navigation

Chat web app using Angular and Websocket

home

Project generated with Angular CLI version 11.1.4.

Build

ng build

Requirements

Before running the web app we need to prepare the associated chat server, we must run the backend (chat server) and then use the exposed APIs to manage a chat rooms (see chat-server-with-nestjs-and-websocket README.md)

Run

Run ng serve for a dev server. Navigate to http://localhost:4200/.

Connections modes

Before connecting to a room, we need to create it in the backend first, example: To crete a room demo-room on the backend we call the endpoint

POST http://localhost:3000/api/v1/rooms

with body:

{"roomId": "demo-room","creatorUsername": "your-username"}

The chat 😉

connection

Connection status (ex: reconnection)

reconnection

Websocket config

Create Socket config on app.module.ts like: const config: SocketIoConfig = { url: 'http://localhost:3000', options: {}}; and then add this module Socket config SocketIoModule.forRoot(config) on imports. It will connect the Socket part of the app to the server.

About

Chat web app using angular and WebSocket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors