DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 967,611 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Pedro Emanoel
Pedro Emanoel

Posted on

How to build microsservices with Spring Boot and AWS with Fargate and DOCKER - Part 1

Image description
Image description

What is SPRING?

The Spring is a java framework open-source most used nowadays in the java platform, it comes to resolve problems that in the old days was give us headaches and made us waste time with configurations. yours libraries and facilities, make the developer just worry on resolve the specific problems

What is AWS?

Documentation about Spring cloud and AWS

Amazon Web Services, also know as AWS, is a service platform of cloud computing made by Amazon, the services are offered
in differents geografics regions around the world.

Serviços e Bibliotecas

Neste treinamento estaremos utilizando:
In this training we use:

Creating a project with Spring

first of all, make a spring project with those dependencies create project as gradlew:
Image description

obs: add the spring actuator dependency in gradlew archive

Creating the first EndPoint

Image description

you will create a new package called controllers and inside the package you will make a class called TesteController, on top of the class we have importants annotations that transform the class on a controller.

@RestController -> Is for spring recognize the class how a rest Controller

@RequestMapping("/api") -> set a definition initial path to the class, for us to access endpoints of this class, we need put /api before endpoint address.endereço do endpoint

@Slf4j -> Lombok annotation used to us make our logs

@PathVariable -> Take the param {name} to url

Run the project and go test the endpoint with INSOMNIA

Insomnia REST

TESTING THE ENDPOINT

First , create a request
Image description

Then
Image description

give a name to request and click on create.

next

Image description

write the endpoint url and click on "SEND"

Image description

well, we have the response status "OK = 200" and the body is the name that us passed by url

see u in the part 2

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.