> For the complete documentation index, see [llms.txt](https://johnkazer.gitbook.io/core-web-dev-concepts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://johnkazer.gitbook.io/core-web-dev-concepts/web-servers.md).

# Web servers

* Express
* NodeJS
* Azure AD

In terms of the server running locally, this can be started locally via the terminal with 'nodemon' (short for Node monitor) using command 'npm run server' and is found in the browser with url '<https://localhost:3000>'. The server code begins with `server.js` which starts the server and which uses `app.js` to create the details. There are two important parts to `app.js`, the `index` const which deals with routes and the reference to static content in 'dist'.

* The static content in 'dist' is of course where the browser code is found - and so the server knows where to  'serve' the webpage from.&#x20;
* `index` is where the server code is pulled together, using ./routes/index.js'.&#x20;

  &#x20; ○ There is a list of routes, which are variously called 'URLs', 'endpoints' and 'an API'. Strictly an API is a collection of URLs or endpoints which provide some functionality. In this case, the API gives access to our server which is what manages the link to the database. In this way, the database is protected from external attack (you have to sign-in to get in), the logic to handle database actions is controlled and can be changed independently of the PT website. For example, we could switch to a different database and the website would not even know.

  &#x20; ○ The routes are defined as GET and POST options, which signify requests for (GET) or submission of (POST) data.

  Each route has an associated function, which provides data security checks and carries out the requested actions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://johnkazer.gitbook.io/core-web-dev-concepts/web-servers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
