Download Latest Version v0.5.0 source code.tar.gz (236.7 kB)
Email in envelope

Get an email when there's a new version of Polka

Home / v0.4.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2018-05-14 1.5 kB
v0.4.0 source code.tar.gz 2018-05-14 180.1 kB
v0.4.0 source code.zip 2018-05-14 219.2 kB
Totals: 3 Items   400.7 kB 0

Minor Changes

  • Add new opts.server option: 276056c, e93ae66, d2f5f96 This allows Polka to attach to predefined, existing servers. It's an alternative approach to booting Polka and wrapping it with another parent server.

  • Initialize server only when needed: 276056c Without this, all sub-applications were preemptively booting up http servers. This meant that all servers were just utilizing memory & never served a purpose, since only the main application's server mattered.

    This change means that the following code sample no longer works:

    js let { server } = polka(); //=> before: "server" was http.Server //=> current: "server" is undefined

  • Rename req.pathname to req.path (#29): 7d467f3 This is for Express compatibility. A lot of popular apps/middlewares rely on req.path (like webpack-dev-server) & it doesn't make to maintain req.pathname and req.path values.

Patches

  • Push root-based middleware group into global middleware: 46285f9 This is mostly a Express-compatibility thing; funky but a needed workaround for some.

Chores

  • Fix readme docs: 37fe875, 46086ae
  • Rewrite tests with async for convenience / sanity: c17440f
  • Fix tests after trouter@1.1.0 update: 8af07b5

Examples

  • Added examples/with-nuxtjs: ff27865
  • Added examples/with-graphql: b929ada
  • Added examples/with-sirv: 1284606
Source: README.md, updated 2018-05-14