As I was diving into the socket.io's get-started guide, I stumbled upon a module requirement that left me puzzled:
var app = require('express')();
var http = require('http').Server(app);
The explanation provided by the author is as follows:
Express initializes app to be a function handler that you can supply to an HTTP server (as seen in line 2)
I couldn't find any clear explanations for this specific usage in the documentation I checked. So, what exactly is going on here? Although Socket.io is mentioned, my question is unrelated to it and is purely focused on understanding this coding snippet. Not sure if this falls under a simple or complex query...