Skip to content

Latest commit

 

History

History
106 lines (81 loc) · 1.56 KB

README.md

File metadata and controls

106 lines (81 loc) · 1.56 KB

Wallett

Simple HTTP REST API that helps you take control of your money, manage multiple resources, like: users, wallets and transactions.

Currently supported database is SQLite. Any SQL database should work.

Endpoints

All endpoints are available below.

POST /api/v1/users

Creates an user with email and password. Example:

curl --request POST \
  --url http://localhost:3333/api/v1/users \
  --header 'Content-Type: application/json' \
  --data '{
	"email": "[email protected]",
	"name": "Bruno Lombardi",
	"password": "123456",
	"password_confirmation": "123456"
}'

201 CREATED:

{
	"id": "u_uZpAwRNITM",
	"email": "[email protected]",
	"name": "Bruno Lombardi"
}
GET /api/v1/users

List all users. Example:

curl --request GET \
  --url 'http://localhost:3333/api/v1/users?Page=1&Limit=10'

200 OK:

{
  "total_pages": 1,
  "count": 1,
  "per_page": 10,
  "page": 1,
  "data": [
    {
      "id": "u_uZpAwRNITM",
      "email": "[email protected]",
      "name": "Bruno Lombardi"
    }
  ]
}
GET /api/v1/users/{user_id}

Fetch user by id. Example:

curl --request GET \
  --url http://localhost:3333/api/v1/users/u_uZpAwRNITM

200 OK:

{
  "id": "u_uZpAwRNITM",
  "email": "[email protected]",
  "name": "Bruno Lombardi"
}

Install dependencies

➜ go mod download

Run

➜ go run main.go

Build

➜ go build