robfig/revel — pull request #89 by jgraham909 (2013-02-20 08:40:46+00:00)
Title: Implement Static conroller to serve static files via normal routes

Overall I think this is in a pretty good place for a first pass, there are likely some areas where I missed functionality though.

A couple notes to mark for closer review;
- I adjusted 'routePattern' regex in router.go I believe this broke the staticFile and staticDir syntax, but since those will be deprecated that should be okay. Parenthesis are optional on the end of route definitions.
- Fixed parameters/arguments follow the csv syntax eg. "arg1","arg2","arg3" (most notably note the lack of spaces after the commas
- I refactored the hotel booking sample to use the new Static controller, but nothing else outside of the revel package.

Things potentially left to do but I thought best to check in and ensure we agree on the route forward and that everything so far is sane.
- Completely remove StaticDir, StaticFile, StaticFilename routes and code
- Fix the benchmark in server_test.go. As you can see I made a first attempt, but it isn't quite right. Once this is back in line we can figure out where we are at performance wise. From a previous naive benchmark it seemed that going through RenderFile vs. ServeFile was about 30% slower (12-13ms vs. 9-10ms respectively). If most of the issue is not in routing we will likely want to look into exposing a responseWriter so we could short-circuit the request if we get a static route.

Last line here is for anybody coming at a later date;
Development was spawned from; https://groups.google.com/d/topic/revel-framework/p7KSXtVdLCA/discussion