Skip to content

Releases: Bessonov/node-http-router

v2.3.0 2022-08-28

27 Aug 23:23
701830e
Compare
Choose a tag to compare

What's Changed

v2.2.0 2022-08-21

20 Aug 22:10
2f67545
Compare
Choose a tag to compare

Reintroduce default handler from pre-v2 again. Actually, this option is optional and not documented, because in this state it's a workaround to more general concept which can be called "ordering of matchers". It allows putting a very last matcher being at the top of router creation.

Currently, I have no idea (and TBH I didn't spend time on it) how to do it the right way. Despite there are many options like adding an attribute or a global sorter function, none of them feels like a solution. Because of that, use this option only if you migrate from pre-v2. I'm pretty sure the option will be removed again.

What's Changed

v2.1.0 2022-08-10

10 Aug 23:03
ad189c9
Compare
Choose a tag to compare

What's Changed

  • add source code to match the source maps (#8) @Bessonov

v2.0.0 2022-06-24

24 Jun 00:20
d74d81d
Compare
Choose a tag to compare

I am proud to present the new release with new features! While the core concept is still the same, there are big changes on boundaries.

First of all, the router isn't tied to node or http anymore! Although the primary use case is still node's request routing, you can use it for use cases like event processing now. See the example in README.md.

For that reason the mandatory 404 route inside the Router's constructor was removed. Furthermore, built-in matchers are now contract based and don't expect concrete IncomingMessage and ServerResponse instances.

Another big feature is the support of nested routers. This is useful for example for modularization or removing url prefix in a multi-tenant SaaS application.

Breaking changes / migration

// before
const router = new Router((req, res) => send(res, 404))

// after
const router = new NodeHttpRouter()

router.addRoute({
	matcher: new BooleanMatcher(true),
	handler: ({ data: { res } }) => send(res, 404),
})
// before
handler: middlewares(async function myApi(req, res, {
	token,
}) {

// after
handler: middlewares(async function myApi({
	data: {
		req, res, token,
	},
}) {
// before
new ExactQueryMatcher({
	response_type: 'code',

// after
new ExactQueryMatcher({
	response_type: ['code'] as const,

What's Changed

v1.0.0 2022-04-22

22 Apr 21:10
419d201
Compare
Choose a tag to compare

After more than 2 years in production I'm confident to declare the router as stable and introduce semver. Of course, there is still a lot of work ahead!

What's Changed

v0.0.9 2022-04-09

08 Apr 23:07
c50b03e
Compare
Choose a tag to compare

What's Changed

v0.0.8 2022-03-06

06 Mar 13:45
Compare
Choose a tag to compare

What's Changed

v0.0.7 2022-03-06

06 Mar 11:44
622e185
Compare
Choose a tag to compare

What's Changed