NodeJS: Creating a tree from a string for http routing
I am trying to create a tree like radix tree for http routing My code: interface Node { nodes?: Record<string, Node> methods?: Record<string, () => unknown> } class Tree { root: Node constructor() { this.root = {} } insert(path: string, method: string, handler: () => unknown): void { let node = this.root path.split(‘/’).forEach((path: string): void… Read More NodeJS: Creating a tree from a string for http routing