Clone this repo and run
docker-compose build && docker-compose up
Run the following commands:
$ docker exec -it ${your_docker_postgres_instance_hash} bash
# -$ psql -U $POSTGRES_USER -w $POSTGRES_PASSWORD -d $POSTGRES_DB
db-todo=# CREATE TABLE todo (id SERIAL PRIMARY KEY, description VARCHAR(255));
For pgadmin initialization follow the next steps:
- Open localhost:54105
- Login with the default credentials setted in docker-compose.yml file as PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD respectively on pgadmin service
- Create new server with the following data (if no data provided, left that space as default)
- General:
- Name = "db-todo"
- Connect now = true
- Connection:
- Host / Name address = "db-todo"
- Port: 5432
- Maintenance database = "db-todo"
- Username: $POSTGRES_USER into docker-compose.yml db-todo service.
- Password: $POSTGRES_PASSWORD into docker-compose.yml db-todo service.
- Save password: true
-
root
/todos
-
GET:
/todos
- Get all todos -
GET:
/todos/:id
- Get one todo by id -
POST:
/todos
- Create new todo
"body": {
"description": "your description"
}
- PUT:
/todos/:id
- Update todo
"body": {
"description": "your description"
}
- DELETE:
/todos/:id
- Delete todo - GET:
/actuator
- Healthcheck endpoint