Closed slavikm closed 9 years ago
Could you explain more about the directory thing? I don't understand what it is doing.
The Dir is used in scenarios where you cannot map the entire thing because of conflicts. For example, using github.com/julienschmidt/httprouter. Since I have /x mapped, I cannot map /*filepath to the entire FS so I have the following code:
r.Get("/xxx", someHandler)
r.ServeFiles("/css/*filepath", Dir(conf.IsDev(), "/css/"))
r.ServeFiles("/img/*filepath", Dir(conf.IsDev(), "/img/"))
r.ServeFiles("/js/*filepath", Dir(conf.IsDev(), "/js/"))
r.ServeFiles("/vendor/*filepath", Dir(conf.IsDev(), "/vendor/"))
r.ServeFiles("/video/*filepath", Dir(conf.IsDev(), "/video/"))
Makes sense?
Ok, makes sense now.
LGTM. Could you squish these into 1 commit and force push the branch back up? I'll merge it then.
I squished and merged this with you as author.
See commit comments - added -condense, -ignore and a Dir func.