DEV Community

Discussion on: Netlify CMS with Gatsby - Best Option with Some Quirks

p4lm profile image
Henrik Sommerfeld Author

For local development I have to following code in cms.js:

const isDevelopment = process.env.NODE_ENV === 'development';

if (isDevelopment) {
  window.CMS_ENV = 'localhost_development';
  const fileSystemBackend = require('netlify-cms-backend-fs');
  CMS.registerBackend('file-system', fileSystemBackend);

config.yml then contains the following:

    name: file-system
    api_root: /api

Checkout the linked files or clone the entire repo to see how it fits together.