# Routes

## Introduction

The next step in the MDN express tutorial sets up all the routes and controllers you're going to need when creating the Library project. This project is designed using the MVC (Model, View, Controller) architecture. In a previous step you set up all the Models (or Database Objects) and in the *next* step you'll be setting up several different views.

If you remember from our earlier lessons, the controller is the code that sits between the models and the views. It determines which view is going to be shown, as well as which information is going to populate that view. In this lesson, you will copy and paste quite a bit of repetitive code to get the controllers and routes set up, but be sure to read everything in between them! There is a *lot* of useful information therein.

## Learning outcomes

By the end of this lesson, you should be able to do the following:

* Create simple routes.
* Create route-handler callback functions.
* Create a catalog route module.
* Describe approaches for structuring routes and controllers.
* Set up URL endpoints.

## Assignment

* Continue where we left off with part 4 of the [Express tutorial](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/routes)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://howtocode.trek.io/topics/deep-dives/nodejs/express/routes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
