nails-boilerplate 2.0.6 → 2.0.8

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.
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  // Sets the Nails global object
2
- import nails, {initializeModels} from './lib/nails.js';
2
+ import nails from './lib/nails.js';
3
3
 
4
4
  export default nails;
5
5
 
6
- export const initializeModels = initializeModels;
7
6
  // set up Nails here
@@ -3,12 +3,14 @@ import pkg from 'body-parser';
3
3
  const {urlencoded, json} = pkg;
4
4
  import express from 'express';
5
5
  import expressWs from 'express-ws';
6
+ import cookieParser from 'cookie-parser';
6
7
 
7
8
  /**
8
9
  * Singleton express application.
9
10
  */
10
11
  // var express = require('express');
11
12
  var app = express();
13
+ app.use(cookieParser());
12
14
  // TODO: this has to be done before routes in order to work. Can consider allowing the config to turn this off
13
15
  // expressWs(app);
14
16
  // Parse application/x-www-form-urlencoded
package/lib/nails.js CHANGED
@@ -32,7 +32,7 @@ nails.Controller = Controller;
32
32
  nails.Model = ModelV2;
33
33
  nails.events = new EventEmitter();
34
34
  nails._dbConnector = null;
35
- nails.MODELS = {};
35
+ nails.MODELS = {init: initializeModels};
36
36
 
37
37
  async function configure( app_config ) {
38
38
  express_app.set('nails_config', application);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nails-boilerplate",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "A node.js webserver scaffold",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -28,6 +28,7 @@
28
28
  "@babel/core": "*",
29
29
  "@babel/preset-react": "*",
30
30
  "body-parser": "^2.2.0",
31
+ "cookie-parser": "^1.4.7",
31
32
  "ejs": "*",
32
33
  "express": "*",
33
34
  "express-ws": "*",