20 Routing, Routes, and Models

At this point, you have the shell for your Tracker application. Now you need to decide what pages – or routes – your application will contain.

Routing is like a traffic cop: When a user pulls up a specific URL, routing directs the user to the data that makes up that page. In earlier projects, you built event listeners for form submission and button clicks. Routing is like an event listener, but it watches for changes to the current URL.

Every website uses some form of routing. For example, if you go to www.bignerdranch.com/​we-teach/, the server maps the route /we-teach/ to the HTML files in a folder on the server named we-teach. Other servers may do it differently: Instead of retrieving static ...

Get Front-End Web Development: The Big Nerd Ranch Guide 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.