Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Agenda ● Understand about express.js ● Create simple REST APIs with express.js (Hands-on) ● About socket.io library ● Build a minimal chat app (Hands-on)

Slide 3

Slide 3 text

Tools ● Node ● NPM ● Visual Studio Code ● Postman

Slide 4

Slide 4 text

What is Express? Fast, unopinionated, minimalist web framework for node. Note: It is a backend or server-side framework!

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Why use Express? ● Makes building web applications with Node.js easier & faster ● Very light & extremely fast ● Provides robust routing ● Dynamically render HTML pages (templating engines -- 14+)

Slide 8

Slide 8 text

Basic Syntax Express vs Node simple code!

Slide 9

Slide 9 text

Middleware Middleware functions are those pieces of code that have access to the user’s request, application response and next middleware to be used. ● Gives developers access to add, remove/modify various features in the application Picture credits: https://developer.okta.com/blog/2018/09/13/build-and-understand-express-middleware-through-examples

Slide 10

Slide 10 text

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Real-time Communication ● Polling ● Web Sockets Polling ● Consumes server threads & bandwidth

Slide 14

Slide 14 text

WebSockets ● Provides bi-directional, full-duplex communications over one single TCP connection ● Communications done over TCP port 80 or 443

Slide 15

Slide 15 text

Socket.IO ● Enables real-time bi-directional event-based communication ● Works on every platform, browser and device focusing equally on reliability and speed. Used for: ● Real-time analytics ● Streaming ● Instant messaging & chat ● Documents Collaboration

Slide 16

Slide 16 text

Slide 17

Slide 17 text

Assignment ● User typing functionality ● Number of users in the room functionality ● User left functionality Many more...

Slide 18

Slide 18 text

Source code ● All source code will be made available on IE-NITK GitHub Page https://github.com/IE-NITK/ ● Will be updated in the video’s description

Slide 19

Slide 19 text

Thank You!