nails-boilerplate 2.0.7 → 2.0.9

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.
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nails-boilerplate",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
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": "*",
@@ -22,10 +22,12 @@ export default [
22
22
  ['get', "/", {controller: 'home'}],
23
23
  // Routes all requests starting with /public as static requests to the public folder.
24
24
  ['get', '/public', {public: true}],
25
+
25
26
  // A test route which routes the first part of pathname to controller and the second to the action
26
- ['get', /^\/(\w+)\/(\w+)$/i, {0: 'controller', 1: 'action'}],
27
+ // ['get', /^\/(\w+)\/(\w+)$/i, {0: 'controller', 1: 'action'}],
28
+
27
29
  // Maps the first two parts of the path to controller and action, and the third to the id parameter
28
- ['get', "/:controller/:action/:id"],
30
+ // ['get', "/:controller/:action/:id"],
29
31
 
30
32
  // For all other GET requests, render HomeController#index
31
33
  ['get', '/:catchall', {controller: 'home'}],