Pismo is an API for creating account transactions
$ git clone https://github.com/DiegoSantosWS/pismo.git && cd pismo
To use the API you should check the file docker-compose.yml
, on file contains the information connections with the database
Create the file .env
in the principal dir.
PG_HOST=<HOST_DB>
PG_USER=<USER_DB>
PG_PASS=<PASS_DB>
PG_PORT=5432
PG_DB=<DB_NAME>
To run the Pismo API you should execute the command below.
$: docker build . -t pismo:latest
The command generates the image docker for the programmer.
Now you need to create the database, you can look config in the file docker-compose.yml
, to execute the file you need to run the command below.
$: docker-compose up
You can run each service separately, for example:
$: docker-compose up pismo
$ docker-compose up -d postgres
Don't haveing difference on format that you execute, are only formats differents
After of run open the browser or postman and run the endpoints
You too can execute the Pismo API using the command sh.
$: sh deploy.sh
This command will to do download of image
diegosantosws/pismo
, and start all services.
#create account
curl -X POST http://localhost:8080/account
-H 'Content-Type: application/json'
-d '{"doc_number":01425836930}'
#create transactions
curl -X POST http://localhost:8080/transactions
-H 'Content-Type: application/json'
-d '{"account_id":1,"operations_types_id":4,"amount":7800.00}'
curl -X GET http://localhost:8080/account/1
{
"id": 1,
"doc_number": "05769904496",
"created_at": "2022-10-05T19:08:05.034872Z"
}