Spring Microservice - Config Server + Discovery Server + API Gateway + Schools & Students API's + Zipkin
# Containers Docker Network Creation
docker network create my-network
docker-compose up -d
or
docker-compose -f <docker-filename> up -d
# PGAdmin (Local)
Use host.docker.internal or postgres instead of localhost
Zipkin: http://localhost:9411/
Now we can access API's via API Gateway url:
api-service-endpoint:
http://localhost:8222/{api-service-endpoint}
Schools: /api/v1/schools Students: /api/v1/students
# - schools
POST -> http://localhost:8222/api/v1/schools
{
"name":"My's School",
"email":"{{$randomEmail}}"
}
GET -> http://localhost:8222/api/v1/schools/with-students/{id}
# - students
POST -> http://localhost:8222/api/v1/students
{
"firstname":"{{$randomFirstName}}",
"lastname":"{{$randomLastName}}",
"email":"{{$randomEmail}}",
"schoolId": 1
}