This is very interesting, similar to serverless functions on Vercel or many other services. Will be interested to give it a try. Can you explain why there needs to be a compilation step?
The `canary` branch implements the same thing but instead of a object tree , it creates a flat object and uses regex's to find the registered handler which is faster but creates an overlap which I'm trying to fix.
In simple senses, it there's to make sure that the router only passes down the req,res to the valid handler and doesn't do any other processing other than maybe, query parsing and param parsing