@nakedcreativity/cee-ms-node 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +5 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -105,8 +105,7 @@ function ceems(config) {
105
105
  this.app.post(/draft\/(.*)/, (req, res)=>{
106
106
 
107
107
  // validate authorisation JWT here
108
- this.site = JSON.parse(fs.readFileSync('./pages/site.json', 'utf8'));
109
-
108
+
110
109
  //console.log(req.body.page)
111
110
  req.query.edit = true;
112
111
 
@@ -193,9 +192,10 @@ ceems.prototype.render = function(req, res, page=null) {
193
192
  // to-do: we need to give module access to entire page object, and therefore the 'sitemap' and other site information
194
193
  var scope = module.content
195
194
  scope.page = page
196
- scope.site = this.site.site
197
- scope.pages = this.site.pages
198
-
195
+ if (this.site){
196
+ scope.site = this.site.site
197
+ scope.pages = this.site.pages
198
+ }
199
199
  this.engine.parseAndRender(moduleTemplate, scope)
200
200
  .then(function(html){
201
201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nakedcreativity/cee-ms-node",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Cee.ms for Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {