Linux Web Servers: From Iterative to Epoll

ยท

1 min read

When I fire up my code editor to create a web server that serves incoming requests, usually I don't care what-the-heck is going on underneath. Modern programming languages abstract away all the underneath details from you and give you a few functions in their standard library to create a decent web server in a few lines of code. The popular NodeJs framework, ExpressJs, actually makes it as simple as :

const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => {
  res.send('Hello World!')
})

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})

This is pretty amazing in terms of simplicity and productivity boosting. But, it is a bit annoying for me to just use a ready-made functions without knowing how my server is handling incoming requests, and

ย