Remote storage returning 204 NO CONTENT
Question
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)
The remote storage doesn't expect any kind of return from the store endpoint, so any 2XX status code is ok
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.
Issue #620
Remote Storage
I'm trying to use the remote storage but no success, with the resolved issues I manage to adjust eveything as it best, but editor do not re...
Issue #597
storageManager: Loading from remote storage
Hi, I'm trying to read the HTML and CSS from my database. When I try to load it into the editor, nothing displays. I can store the data jus...
Issue #1150
[Question] Get Uploads as Base64
Hello All, I need help integrating this into a web app that I have. Everything renders and works as expected but I am trying to get the upl...
Issue #1274
Remote storage option is not sending in $_POST the JSON structure
Hi @artf! I'm working to adapt your content builder in our system using the latest release v.0.14.21. I have set up the following configura...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.