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 uphttp
servers. This meant that all servers were just utilizing memory & never served a purpose, since only the main application'sserver
mattered.This change means that the following code sample no longer works:
let { server } = polka(); //=> before: "server" was http.Server //=> current: "server" is undefined
-
Rename
req.pathname
toreq.path
(#29): 7d467f3
This is for Express compatibility. A lot of popular apps/middlewares rely onreq.path
(likewebpack-dev-server
) & it doesn't make to maintainreq.pathname
andreq.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