> For the complete documentation index, see [llms.txt](https://eleven-fifty-academy.gitbook.io/javascript-152-nodeserver/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eleven-fifty-academy.gitbook.io/javascript-152-nodeserver/js_library/node-server/03-routes-intro/01-routes-intro.md).

# 01 - Routes intro

In this module, we'll introduce the concept of routes.

## Routing Defined

Routing refers to determining how an application responds to a client request to a particular endpoint. An endpoint is a path and a specific HTTP request method attached to that path (GET, POST, DELETE, PUT).

## Overview

Here's a rough diagram of what's happening with our recent code that was used as a test in Postman:&#x20;

![screenshot](https://785407262-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAU8YfspjIVOP2BrMNl%2F-LAU8cHEwYbpO3Obye5i%2F-LAU8oLG19aithMKhU8w%2F01-router-endpoint-diagram.png?generation=1524162326578443\&alt=media)

## Analysis

1. A GET request is made to localhost:3000/api/test.
2. When the route is requested, Express finds the method for the specific route. The method that we already added for testing Postman is below:

   ```javascript
   app.use('/api/test', function(req, res){
    res.send("This is data from the /api/test endpoint. It's from the server.");
   });
   ```
3. So when we go to the `/api/test/` endpoint, we fire off an Express function `res.send`.
4. `res` (short for `response`) handles packaging up the response object.
5. The `.send()` method does the job of sending off the response.
