Skip to content

v1.1.0

Choose a tag to compare

@LebCit LebCit released this 31 May 09:44
· 139 commits to main since this release

New Feature

  • Add option to initiate a LiteNode instance without specifying a static asset directory.
  • Apply middleware(s) in merged and nested routes only to the specified route.

Details

In the previous version, creating a LiteNode instance without an existing static asset directory would trigger a warning message.
Starting v1.1.0 LiteNode can be used without a static asset folder and avoid warning messages:

const app = new LiteNode("__NO_STATIC_DIR__")

This "__NO_STATIC_DIR__" string will do the following:

  1. Skip serving static assets and avoid logging warnings to the console.
  2. Apply middleware(s) to specified route only in merged and nested routes.

More about the second aspect, with details and example, in the Merging and Nesting with Middlewares section of the documentation.

Changes

  • Unify CJS and MJS versions of LiteNode into one file "litenode.js".
  • Check for __NO_STATIC_DIR__ upon LiteNode's initialization.
  • Set nested instance(s) of LiteNode to skip serving static assets by default to prevent unintended traversal of their middleware(s) in the reverse direction.
  • Update README with example for merge and nest with middleware(s)