aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 4e81a1d2449ede593cd0b28266f38b9298c29b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Bank API

Bank API built with [Node.js](https://nodejs.org) plus [Express](https://expressjs.com/).

## Running the server

Make sure you have [Node.js](https://nodejs.org) installed.

1. Git clone this repo
2. Run `npm install` and wait for the packages to be installed
3. Run `npm start` and you are good to go.

The server should start listening on port `5000`.

> Note: all entries are stored in-memory and are not persisted, so when the server is stopped all data is lost.

## API details

Route                                         | Description
----------------------------------------------|------------------------------------
GET     /api/                                 | Get server info
POST    /api/accounts/                        | Create an account, ex: `{ user: 'Yohan', description: 'My budget', currency: 'EUR', balance: 100 }`
GET     /api/accounts/:user                   | Get all data for the specified account
DELETE  /api/accounts/:user                   | Remove specified account
POST    /api/accounts/:user/transactions      | Add a transaction, ex: `{ date: '2020-07-23T18:25:43.511Z', object: 'Bought a book', amount: -20 }`
DELETE  /api/accounts/:user/transactions/:id  | Remove specified transaction

## LICENSE

[GNU AGPLv3+](LICENSE)