From 69868b13e89c3569852c8dfbc51e18f88da08465 Mon Sep 17 00:00:00 2001 From: Simon Rozsival Date: Wed, 23 Nov 2016 22:40:36 +0100 Subject: [PATCH] Updated Web application (markdown) --- Web-application.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Web-application.md b/Web-application.md index 113c077..b860f4a 100644 --- a/Web-application.md +++ b/Web-application.md @@ -28,7 +28,8 @@ The whole project is written using the next generation of JavaScript referred to The redux [store](https://github.com/ReCodEx/web-app/blob/master/src/redux/store.js) is extended with several middlewares - [redux-thunk](https://github.com/gaearon/redux-thunk), [redux-promise-middleware](https://github.com/pburtchaell/redux-promise-middleware), router middleware, accessTokenMiddleware, and apiMiddleware. #### apiMiddleware -- @todo: apiMiddleware + +The API middleware catches all the `'CALL_API'` actions and turns them into a HTTP request via the [fetch API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API). The middleware deeply converts data in the *body* part of the request to `FormData` and sets correctly the headers and creates endpoints for the API server before each request is sent. The middleware also handle the responses - converts them to the format expected by the reducers and catches requests' failures. #### accessTokenMiddleware