Chapter 15: Example Real-time Multiplayer Quiz: Express Code

The Express part of the quiz application:

  • imports questions from the Open Trivia Database
  • allows a player to create and start a new game with specific defaults
  • allows other players to join that game

It serves all the client-side HTML, CSS, and JavaScript files. Eventually, users on the same game end up at the URL /game/<gameCode>/<playerName>, where the WebSocket server (see Chapter 16) takes over and controls the gameplay.

Docker starts two isolated HTTP servers and a single request could be directed to either by the Traefic load balancer. Even two requests from the same user on the same page—such as a CSS and JavaScript file—could be delivered by different servers. This is rarely ...

Get Node.js: Novice to Ninja now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.