@apolitical/server 2.6.0 → 2.7.0-rc.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.7.0] - 2022-08-22
9
+ ### Added
10
+ - Strict routing parameter to allow treating "/foo" and "/foo/" as different
11
+
8
12
  ## [2.6.0] - 2022-07-25
9
13
  ### Updated
10
14
  - `buildOptions` helper: use sessionSecret from argument if not in process.env
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/server",
3
- "version": "2.6.0",
3
+ "version": "2.7.0-rc.1",
4
4
  "description": "Node.js module to encapsulate Apolitical's express server setup",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
@@ -13,6 +13,10 @@ module.exports = ({
13
13
  return async function load(app, opts) {
14
14
  const childLogger = logger.where(__filename, 'load');
15
15
  childLogger.debug('Started');
16
+ // Enable strict routing (treat "/foo" and "/foo/" as different)
17
+ if (opts.strictRouting) {
18
+ app.enable('strict routing');
19
+ }
16
20
  // Load probes
17
21
  probesLoader(app, opts);
18
22
  // Load useful middlewares
@@ -2,11 +2,11 @@
2
2
 
3
3
  module.exports = ({
4
4
  bodyParser: { json, urlencoded },
5
- express,
6
5
  compression,
7
6
  cors,
8
7
  cookieParser,
9
8
  prerender,
9
+ express,
10
10
  config,
11
11
  logger,
12
12
  }) => {