karlseguin / router

A fast standalone router for Go.
MIT License
19 stars 2 forks source link

Howto handle static files? #3

Open vit1251 opened 7 years ago

vit1251 commented 7 years ago

I can not find a static file handler like in httprequests.

karlseguin commented 7 years ago

If I was starting a new Go project, I'd probably use https://github.com/julienschmidt/httprouter

That point aside, there's no special way to handle static files. Set up a route and maybe io.Copy from the an os.Open(path), to the response writer.