Server API
We will have a simple REST API for manipulating TODO items.
For your convinience we have already implemented test API methods that return sample data.
It can be found at Application\test\data\todo\
.
By default applicaiton uses internal test API that stores data in localstorage.
To switch application to your server API open file Application\src\utils\api.js
.
Uncomment import of server and comment out import of test data:
import store from '../store';
import utilities from './utilities';
import server from 'server';
//import server from '../../test/data/server';
...
API contains these methods:
Method | Url - | Description |
---|---|---|
GET | todo\ | Retrieves all items |
POST | todo\ | Creates item |
PUT | todo\{id} | Updates item |
DELETE | todo\{id} | Deletes item |