[[endpoints.GET]]
path = "/health"
status = 200
body = "API is up and running"

[[endpoints.GET]]
path = "/users"
status = 200
body = '''
[
  {
    "id": "{{rand}}",
    "name": "{{arg.name}}",
    "email": "",
    "path": "{{path}}"
  }
]
'''

[[endpoints.GET]]
path = "/users/{{name}}"
status = 200
body = '''
{
  "id": 1,
  "name": "{{name}}",
  "email": ""
}
'''

[[endpoints.GET]]
path = "/users/{{name}}/{{id}}"
status = 200
body = '''
{
  "id": "{{id}}",
  "name": "{{name}}",
  "email": ""
}
'''

[[endpoints.POST]]
path = "/users"
status = 201
body = '''
{
  "id": "{{rand}}",
  "name": "Jane Doe",
  "email": ""
}
'''


[[db]]
path = "/db/cafetera"
data = '''
{
    "db_name": "messages",
    "owner": "Albruiz",
    "users": [
        {
            "id": 0,
            "name": "Alberto",
            "surname": "Ruiz",
            "age": 25,
            "admin": true
        },
        {
            "id": 1,
            "name": "Eithne",
            "surname": "Flor",
            "age": 21,
            "admin": false
        },
        {
            "id": 2,
            "name": "Juan",
            "surname": "Perez",
            "age": 52,
            "admin": false
        }
  ],
  "messages": [
  {
      "id": 1,
      "from": 0,
      "to": 1,
      "content": "Hello, how are you?"
    },
    {
      "id": 2,
      "from": 1,
      "to": 0,
      "content": "I'm good, thanks! How about you?"
    },
    {
      "id": 3,
      "from": 2,
      "to": 0,
      "content": "Hey, what's up?"
    },
    {
      "id": 4,
      "from": 0,
      "to": 2,
      "content": "Not much, just working on a project."
    },
    {
      "id": 5,
      "from": 1,
      "to": 2,
      "content": "Are you free to chat later?"
    }
  ]
}
'''