Skip to content

Darych/moneytransfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Money Transfer

REST API for money transfer without Spring!

Libraries:

  • Jetty as an embedded web server
  • Guice as a DI tool
  • Jackson for JSON serialization/deserializtion.

Create account

Request: POST localhost:8080/account

{
"name": "user1",
"balance": 100
}

Response on success: 201 Created

{
"name": "user1",
"balance": 100.0,
"id": 1
}

Response if input JSON is invalid: 400 Bad request

Get account info

Request: GET localhost:8080/account/{id}

Response on success: 200 OK

{
    "name": "user1",
    "balance": 100,
    "id": 1
}

Response if id could not be parsed: 400 Bad Request

Response if there was server error: 500 Internal Server Error

Make transaction

Request: POST localhost:8080/transaction

{
"from": 1,
"to": 2,
"amount": 25
}

Response on success: 200 OK

Response if transaction JSON could not be parsed: 400 Bad Request

Response if transaction processing failed (no account, no money, transfer to the same account): 406 Not Acceptable


This project is MIT licensed.

About

REST Money Transfer application without Spring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages