Rest API for simple prepaid card, used tech stack
- Java
- Spring Boot
- JPA (Hibernate)
It is simple just execute mvn spring-boot:run
No by default it uses in-memorry database but also it is easy just to change it in application.properties if you want the tables to created in real one.
curl -i -X POST \ -H "Content-Type:application/json" \ -d \ '{ "name":"Coca-Cola", "city":"London", "address":"Kings Road 15", "country":"United Kingdom", "email":"[email protected]", "phone":"+44 123456789" }' \ 'http://localhost:8080/companies'
curl -i -X PUT \ -H "Content-Type:application/json" \ -d \ '{ "name":"Coca-Cola 1", "city":"London", "address":"Kings Road 15", "country":"United Kingdom", "email":"[email protected]", "phone":"+44 123456789" }' \ 'http://localhost:8080/companies/<COMPANY_UID>'
curl -i -X GET \ 'http://localhost:8080/companies/<COMPANY_UID>'
curl -i -X GET \ 'http://localhost:8080/companies'
curl -i -X POST \ -H "Content-Type:application/json" \ -d \ '{ "name":"Elon Musk" }' \ 'http://localhost:8080/companies/<COMPANY_UID>/owners'