Skip to content

Releases: lwsjs/local-web-server

v5.4.0

01 Aug 08:47
Compare
Choose a tag to compare

There were no breaking changes to the API, the minimum version of Node is still v12.20.

Bug fixes

  • If your local ws connection is insecure (HTTP) and you're rewriting one or more routes to a secure (HTTPS/HTTP2) remote server, if the remote response sets a cookie with the attribute secure then that attribute is removed (which is necessary else the browser will refuse to store it via an insecure connection). With this new release, lws-rewrite also removes SameSite=none if it is set alongside secure. See lwsjs/rewrite#14.
  • Max body-parser file size is now 500MB by default (previously, lws would throw an error if attempting to parse a file greater than 1MB). #130
  • Prevent stored config being parsed twice. Fixes #176
  • Dependencies upgraded to address security warnings within the dep tree.

v5.3.0

07 Feb 19:42
Compare
Choose a tag to compare

New features since v5.2.1

v5.1.0

06 Aug 10:17
Compare
Choose a tag to compare

New features since v5.0.0

  • Support extended back to Node.js v12.20
    • This is because support for exports, conditional exports and exports patterns have been retro-fitted back to v12 (see the Package module history)

Upgrade notes

Users of Node.js v12.20 and above may now use local-web-server (previously, you needed a minimum of node v14). There are no further changes.

v5.0.0

06 Jul 11:21
Compare
Choose a tag to compare

This is a refresher release - there are no functional or behavioural changes to the web server itself.

Breaking changes since v4.2.1

  • Dropped support for Node.js < v14
  • Dropped support for CommonJS in general
  • Dropped support for plugin prefixes
    • Previously, you could omit the lws- in plugin names, (i.e. you could use --stack static instead of --stack lws-static). This was ambigious and introduced the risk of incorrectly loading a module named static, if it existed.
  • Several of the API methods have changed from sync to async, most importantly the Lws.create method. You now need to await the result.
    const lws = await Lws.create()
    

New feature

  • The default config file lws.config.js may now also be named lws.config.mjs or lws.config.cjs if preferred.

Other improvements

  • All source code converted from CommonJS to ECMAScript modules.
  • All dependencies upgraded.

Upgrade notes

  • If you previously used shortened plugin names (e.g. --stack static) please use the full name (e.g. --stack lws-static)
  • If you launch a server using Lws.create you must now await the result.
  • Lws can now only be used programmatically from ECMAScript modules - you must use import to load the library.

v4.2.0

23 May 11:54
Compare
Choose a tag to compare

New features since v4.1.0

  • Added a command-line tool to help develop and debug --rewrite rules. This greatly speeds up the development of custom rewrites. Full documentation here.
    • An example, testing a rewrite to a remote server:

      $ npx lws-rewrite '/npm/:pkg' 'https://npmjs.org/package/:pkg' '/npm/renamer'
      https://npmjs.org/package/renamer
      
    • The same feature has also been added to lws-redirect.

v4.1.0

17 May 12:42
Compare
Choose a tag to compare

New features since v4.0.0

Other

v4.0.0

09 Feb 18:47
Compare
Choose a tag to compare

Breaking changes since v3.0.7

  • Dropped support for Node versions < 10.

New features

  • When local-web-server is running in plain HTTP mode (not HTTPS or HTTP2), stripping the secure attribute from remote, rewrite-target cookies is now the default behaviour. Set the --rewrite.keep-secure-attr flag to disable this. #141

Other improvements

  • All dependencies updated to latest versions.

v3.0.0

10 Jun 07:38
Compare
Choose a tag to compare

Breaking changes since v2.6.1

New features

  • --static.extensions. #120, docs
  • --spa.asset-test-fs lwsjs/spa#1, docs
  • --rewrite now works behind an HTTP proxy. #114
  • configFile is now honoured when using programmatic API. #115
  • Lots of new API and wiki documentation written with more to come.

Other fixes

  • Middleware stack plugin loading now works correctly with Node v12.
  • Upgraded and optimised dependency tree.

Upgrade notes

Some tips on upgrading from v2 to v3.

  • If you use --rewrite and have an asterix wildcard in your from expression (e.g. /api/*) you'll need to change the asterix to (.*), e.g. /api/(.*).
  • To upgrade your middleware plugin, check the new API docs. The only difference is that the exported plugin is now a plain class, not a decorator function as before.
  • The main difference with the new programmatic API is that you now launch a server with LocalWebServer.create rather than localWebServer.listen as before.
  • If you use lws-mock-responses, you'll need to install the plugin into your project then include it in a custom stack - example below.
    npm i --save-dev lws-mock-responses
    ws --stack mock-responses static index
    

If you have any questions, post an issue - thanks.

v2.5.0

06 Mar 16:45
Compare
Choose a tag to compare

New features since v2.4.0

Added --http2 option, which uses node's built-in HTTP2 support. See this wiki page for usage examples.

v2.2.3

25 Jul 09:42
Compare
Choose a tag to compare

Bug fix

The built-in --https certificate had expired. This release contains a new certificate valid for ten years. You may need to mark the new certificate as trusted.