Cosi166 Quick Bullets (Tue Jan 25, lect 3) | previous | next | slides |

Remind ourselves about Ruby and the web

Git/Github

  • Unless you are experienced, I recommend avoiding creating branches
  • At the start it’s easy to get into trouble
  • These are commands you should be very familiar with
    1. git init
    2. git clone
    3. git commit
    4. git add
    5. git status
    6. git push
    7. git pull
  • See Git and GitHub

What a web server does

  • Reductionist view
  • Client sends url, server returns html
  • Review of some basic concepts
    1. Client and Server
    2. Client asks for a page; server sends a page
    3. Web server receives the request and creates the page and sends it back
  • A level deeper:
    1. Server (usually) looks inside a database for information
    2. And runs an algorithm on that to create the output
    3. And that’s what gets sent back.

HTTP

  • HTTP verbs
    1. GET - get representation of resource at URI
    2. PUT - replace representation of resource at URI
    3. POST - Add a new resource
    4. others
  • HTTP - Hypertext Transfer Protocol

URI Routes and routing

  • Components of a URI http://cs.brandeis.edu:3000/accounting/homepage?format=summary
    • protocol - http://
    • hostname - cs.brandeis.edu
    • optional port number - :3000
    • path: /accounting/homepage
    • optional query string: ?format=summary
  • Routing: Web Server parses the URI and calls the appropriate code to handle it
  • See URI - Uniform Resource Identifier

Relational Database

Deploying application to Heroku

Models, Views, Controllers

Live coding

Thank you. Questions?  (random Image from picsum.photos)