Sample Video Frame
Exercise 47: A Fast URL Router
I'm now going to show you how I use the TSTree
to do fast URL routing in Web servers that I've written. This works for simple URL routing you might use at the edge of an application, but doesn't really work for the more complex (and sometimes unnecessary) routing found in many Web application frameworks.
To play with routing, I'm going to make a little command line tool that I'm calling urlor
, which reads a simple file of routes, and then prompts the user to enter in URLs.
Register for Learn C the Hard Way
Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.