diff --git a/O-BrandServer/process.json b/O-BrandServer/process.json index 3f175a8..392746d 100644 --- a/O-BrandServer/process.json +++ b/O-BrandServer/process.json @@ -6,6 +6,8 @@ "instances" : 1, "exec_mode" : "cluster", "combine_logs" : true, + "max_memory_restart" : "150M", + "restart_delay" : 5000, "ignore_watch" : ["[\\/\\\\]\\./", "node_modules", "server/static"] }] } diff --git a/O-BrandServer/server/app/pages.js b/O-BrandServer/server/app/pages.js index 42085a2..b34c1fb 100644 --- a/O-BrandServer/server/app/pages.js +++ b/O-BrandServer/server/app/pages.js @@ -75,11 +75,19 @@ module.exports = function(app) { dbPages.addNewPage(req.body.data) .then(function(data) { - let response = { - data: data - }; + dbPages.getPage(data.attributes.pid) + .then(function(data) { + let response = { + data: data + }; + logger.debug(response); + res.status(200).send(response); + }) + .catch((err)=> { + console.error(err); + res.status(401).end(); + }); - res.status(200).send(response); eventHandler.emit('renderPage', data.attributes); })