Tips to using CakePHP 3.x as a ReactJS API backend

Written by James McDonald

January 5, 2018

Information for React I found useful this had a sample project that showed how to setup redux and react and explains the redux ecosystem of store, actions, action creators, reducers etc.

It has a nice example of redux middleware ( check out the source and look in middleware/api.js )

Configure CakePHP 3.x

First follow the direction in the bravo-kernel series here:

Starting with the above there is a chain of posts that take you from start to finish of getting CakePHP API ready.

If using Chrome and the fetch() method you will run into all sort of 501 OPTION not supported errors when trying to get access to your CakePHP API from React

This posting makes a very clean fix:

Responding to HTTP OPTIONS requests in CakePHP

You will need to have some understanding of how to integrate it into CakePHP because it is very nifty middleware:



Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…