# API Server

## Requirements

The libraries we require for this server application are:

* [express](https://expressjs.com/), a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
* [mongoose](https://mongoosejs.com/), a straight-forward, schema-based solution to model your application data.
* [dotenv](https://github.com/motdotla/dotenv), a zero-dependency module that loads environment variables.

### Database

For this project, we use MongoDB as a database. If you don't have a database on your server, please sign up and create one on the [MongoDB platform](https://www.mongodb.com/).

Once you have MongoDB database, create a .env file using .env.example, and put your connection string in the DB\_CONNECTION variable.

### Publish

For this project we use [Heroku](https://www.heroku.com/) to host our NodeJS server. Once you have it [installed](https://devcenter.heroku.com/articles/heroku-cli) on your local computer, login with your credentials:

```
$ heroku login -i
heroku: Enter your login credentials
Email: me@example.com
Password: ***************
Two-factor code: ********
Logged in as me@heroku.com
```

Then create an app, and deploy the code on it:

```
heroku create
git add .
git commit -m "first commit"
git push heroku master
```

And ready; you will now have an URL for your new ZAct API!


---

# 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://nestorbonilla.gitbook.io/zact/api-server.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.
