Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying React w/ WordPress as Backend using WP Rest API

Tags:

How would you go about hosting / deploying a React application with WordPress on the backend? I've been using the WP Rest API plugin and that API seems to need to be hosted. Would I also have to host my front-end React application on a separate server? Or would I somehow be able to put everything onto a shared hosting service like GoDaddy or GreenGeeks?

like image 962
Calvin Avatar asked Oct 27 '17 01:10

Calvin


People also ask

Can I deploy React app to WordPress?

Yes. You can use React with WordPress in cases where WordPress CMS manages React-based front-end content with the WordPress (WP) Rest Application Programming Interface (API). The WP Rest API is one of the significant WordPress features. It allows developers to build captivating themes and plugins.

Can you mix WordPress and React?

Can you use React with WordPress? Yes, React can be used with WordPress, as in the example above, where the content on the front-end built with React is managed by WordPress CMS using the WP Rest API.

Can I use WordPress as backend?

The first step to using WordPress as a back end is remarkably similar to starting a WordPress website. You'll need a WordPress installation loaded with all the content you want on your website or app. This could be an active installation or a new one you set up for your project.


1 Answers

You have a handful of options. You have the power to host React and Wordpress separately, but I prefer to host mine on the same server using docker.

If your curious, check out this starter template: https://github.com/postlight/headless-wp-starter

It's one of my favorites, and it has react pre-wrapped in a docker container with straight forward instructions.

like image 93
Tanner Eustice Avatar answered Sep 30 '22 15:09

Tanner Eustice