Book Image

JavaScript at Scale

By : Adam Boduch
Book Image

JavaScript at Scale

By: Adam Boduch

Overview of this book

Table of Contents (17 chapters)
JavaScript at Scale
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Troubleshooting routers


Once our routers grow to a sufficiently large size, we'll have to troubleshoot complex scenarios. If we know what the likely issues are beforehand, we'll be better equipped to deal with them. We can also build troubleshooting tools into our router instances to aid in the process. Scaling the addressability of our architecture means responding to issues quickly and predictably.

Conflicting routes

Conflicting routes can cause a massive headache because they can be really tricky to track down. A conflicting pattern is a general or similar version of more specific patterns added to the router later on. The more general pattern conflicts, because it's matched against the most specific URIs, which should have been matched by the more specific patterns. However, they're never tested because the general route is executed first.

When this happens, it may not be apparent at all that there's an issue with the routing because the incorrect route handler will run perfectly fine,...