This API fuction is to work as a microservice in Node.js to get a billet info from the billet digitable line.
Run the following command to install necessary dependencies:
npm install
If you want to run tests before running the application do as following:
npm run test
To run the application locally:
npm run start
If you want to run the application in a container, make sure docker is running and run the command:
docker-compose up
Now with the application running locally you can use it by running the following request:
GET http://localhost:8080/boleto/:billetCode
// replace ':billetCode' by the billet digitable line
Example of responses:
statusCode: 200
Body:
{
"barCode": "21299758700000020000001121100012100447561740",
"amount": "20.00",
"expirationDate": "2018-07-16"
}
statusCode: 400
Body:
{
"message": "Boleto inválido: dígito verificador geral inválido."
}