Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Spring Boot Web3jSampleController #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Spring Boot Web3jSampleController #4

wants to merge 2 commits into from

Conversation

maksumic
Copy link

@maksumic maksumic commented Sep 18, 2022

What does this PR do?

Creates a Web3jSampleRestController, which injects the already existing Web3jSampleService, to be able to retrieve the client version by doing:

GET /client/version

Further, it refactors some field-based DI to constructor-based DI, to adhere to Spring best practices. And it adds a dependency on spring-boot-starter-web to be able to run the web service.

Where should the reviewer start?

Start at Web3jSampleRestControllerTest as it covers the expected behavior. To test the changes manually, run an Ethereum client (e.g. Ganache) and go to http://localhost:8080/client/version

Screenshot from 2022-09-18 21-39-37

Why is it needed?

Because it allows the user to start the Spring Boot application with an example REST endpoint, without having to write code; while keeping the example minimal

@maksumic maksumic changed the title Switch to constructor-based DI Spring Web3jSampleController Sep 18, 2022
@maksumic maksumic changed the title Spring Web3jSampleController Spring Boot Web3jSampleController Sep 18, 2022
@maksumic maksumic closed this by deleting the head repository Sep 24, 2022
@maksumic maksumic reopened this Sep 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant