Issue #2020💬 AnsweredOpened May 17, 2019by fillipi10 reactions

Remote storage returning 204 NO CONTENT

快速解答by artf

The remote storage doesn't expect any kind of return from the store endpoint, so any 2XX status code is ok

Read full answer below ↓

Question

代码片段TEXT
I'm trying to save to a remote database from a local grapesjs editor. Although I'm able to hit the endpoint it's giving me a 204 NO CONTENT. 

this is the server I set up: 

 var express=require('express');
 var app=express();
 app.use(bodyParser.urlencoded({ extended: true }))
 app.use(cors());

 app.post('/grapesjs', function (req, res) {
   console.log(req)
  return res.status(200).json({key: 'value'})
});

my grapesjs editor:

 var editor = grapesjs.init({
        height: '100%',
        showOffsets: 1,
        noticeOnUnload: 0,
        storageManager: {
          id: 'gjs-',             
          type: 'remote',          
          autosave: true,        
          autoload: true,         
          stepsBeforeSave: 1,    
          storeComponents: true, 
          storeStyles: true,      
          storeHtml: true,        
          storeCss: true, 
          urlStore: 'http://localhost:8081/grapesjs',
          //urlLoad: 'http://e45d9fde.ngrok.io/grapesjs',
        },
        container: '#gjs',
        fromElement: true,

        plugins: ['gjs-preset-webpage'],
        pluginsOpts: {
          'gjs-preset-webpage': {}
        }
      });

Answers (2)

artfMay 23, 2019

The remote storage doesn't expect any kind of return from the store endpoint, so any 2XX status code is ok

jvrjosephlouieOctober 30, 2019

Hello, im also getting the same response and im not receiving any data from my api. Does it require a request method for it to be able to function successfully? thanks.

const storageManager = { id: 'gjs-', type: 'remote', autosave: true, autoload: true, stepsBeforeSave: 1, storeComponents: true, storeStyles: true, storeHtml: true, storeCss: true, urlStore: 'https://xxxx/store/grapejs/1', urlLoad: 'https://xxxx/load/grapejs/1', }

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.