Updated:

How was the www invented?

  • 1990
  • Tim Berners-Lee and Nicola Pellow built the first web browser

How does it work?

  • In 90s:
  • Hypertext (navigation through hypercards) as HTML, internet as HTTP: WWW (1990)
  • WWW = HTML + HTTP + URL
    • WWW: Extend the idea of hypertext on one computer to hypertext over any computer
    • HTML defines the structure of the document, and how the links work
    • HTTP defines how the messages run between the computers

What is a web app?

  • The web is not the internet; it’s an application that runs on the internet
  • Internet itself is another set of protocols
  • Once you have the TCP/IP layers, you have the ability to build applications at a higher level and invent a protocol that involves messages being sent back and forth.

HTTP

  • v 0.9 (1991) one verb: GET a resource
  • HTML2 (1995) <FORM> tag ○ No longer a read-only web (login names & pw, description of order, etc.)
  • v 1.0 (1996) GET and POST messages
  • v 1.1 (1997) GET POST PUT DELETE a resource
  • (2010) PATCH (partially) update a resource

WWW is client-server

  • Client sends GET/POST/PUT/DELETE request, then the executes the corresponding script. (output is HTML or JSON)
  • Most of the times DB is involved.

Running a server using Node.js

const http = require('http')
// Create a server ready to take action
// Callback function runs everytime server recieves an http request
const server = http.createServer( (req, res) => {
  console.log('someone connected to the server')

  // Add stuff to the browser (make a little web page!)
  res.write('<h1>Hello, world!</h1>')
  res.write('<p>Hello again</p>')
  res.end()
})

// Listen to the server at the particular TCP/IP port
server.listen(8080, () => {
  console.log('listening on 8080')
})

What is a server?

  • a computer running server software (e.g. Apache, MS IIS, Node.js)
  • ‘listens’ on a particular TCP/IP port
  • accepts Requests, sends Responses
  • runs application code to make responses
  • your dev laptop is a server (localhost)
  • can be ‘on premise’ or ‘in the cloud’
  • trend is to host web apps on cloud platforms (e.g. Heroku, Firebase, AWS, Azure)
  • ‘serverless’ auto-scaling
  • microservice architectures

What does a web developer do?

  • design the user interface (a set of HTML files, CSS stylesheets, and other assets)
  • set up and program a web server such that it delivers these assets when requested by authorised users

Leave a comment