Local Web Server Versions Save

A lean, modular web server for rapid full-stack development.

v5.3.0

1 year ago

New features since v5.2.1

v5.1.0

2 years ago

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

2 years ago

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

3 years ago

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

3 years ago

New features since v4.0.0

Other

v4.0.0

4 years ago

Breaking changes since v3.0.7

  • Dropped support for Node versions < 10.

New features

Other improvements

  • All dependencies updated to latest versions.

v3.0.0

4 years ago

Breaking changes since v2.6.1

New features

  • --static.extensions. #120, docs
  • --spa.asset-test-fs https://github.com/lwsjs/spa/pull/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.

2.5.0

6 years ago

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

6 years ago

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.

v2.2.0

6 years ago