Requirements:
- Node.js
- npm
- Express https://expressjs.com/en/starter/installing.html
- mongoose
- Nodemon
- Studio 3T https://studio3t.com/
- JWT
Layers (las capas):
- api/router.js
- api/clients/clients.router.js
- api/clients/clients.controller.js
- api/clients/clients.service.js
- api/clients/clients.repository.js
- api/clients/clients.model.js

req un res always stays in the controller.
return res.json // always with return, otherwise keeps executing the code that follows.
Import – Export
import { hola, adios } from './exportConst.js'; // importing functions as object.
import * as exportConst from './exportConst.js'; // importing all. * is naming the object.
import whatEverName from './exportDefault.js'; // when there is only one function. Possible changing functions name.Controller
The best practice for controllers is to keep them free of business logic. Their single job is to get any relevant data from the req object and dispatch it to services. The returned value should be ready to be sent in a response using res.
Make sure you don’t pass any web layer objects (i.e. req, res, headers, etc) into your services. Instead, unwrap any values like URL parameters, header values, body data, etc before dispatching to the service layer.
params => obligatory
query => optional.
query received as string (true if exist)
JWT



