/netlify-cms-react-example

NetlifyCMS bootstrapped from create-react-app using netlify-cms-backend-fs in development

Primary LanguageJavaScriptMIT LicenseMIT

Netlify Status

netlify-cms-react-example

Edit netlify-cms-app Example

Process to create this example

Create the react app using create-react-app

$ git clone https://github.com/ADARTA/netlify-cms-react-example.git
$ cd netlify-cms-react-example 
$ yarn start

Note: Installing all the libraries are only needed until out of beta, then we will use the new bare library if it is approved. Will then only load the backends needed.

Create the the development proxy for the backend api

$ yarn add netlify-cms-backend-fs --dev

src/setupProxy.js is recognized by the webpack setup in react-scripts, so we use the middleware script from netlify-cms-backend-fs to create the /api endpoint.

Note: this feature is available with react-scripts@2.0.0 and higher.

src/setupProxy.js

    const fsExpressAPI = require('netlify-cms-backend-fs/dist/fs');

    module.exports = fsExpressAPI;

Test the API endpoint by starting the development server using npm run start or yarn start. The proxy api will give you a message telling you the root and site path in the terminal. Browsing to http://localhost:3000/api will confirm the API is up and running by returning a json error object letting you know it is the root of the api.

Creating your custom CMS application

This starter can be the beginning custom CMS or we can use this as a test for an existing NetlifyCMS configuration. Just clone the repository or download.

$ yarn install
$ yarn start

Learn More

This project was bootstrapped with Create React App.

You can learn more in the Create React App documentation.