Issue #2020Opened May 17, 2019by fillipi10 reactions

Remote storage returning 204 NO CONTENT

Question

Code SnippetTEXT
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, 20190 reactions

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

jvrjosephlouieOctober 30, 20190 reactions

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.