View definition

(*Controller).FileHandler

Defined in github.com/goadesign/goa/service.go

Description

FileHandler returns a handler that serves files under the given filename for the given route path. The logic for what to do when the filename points to a file vs. a directory is the same as the standard http package ServeFile function. The path may end with a wildcard that matches the rest of the URL (e.g. *filepath). If it does the matching path is appended to filename to form the full file path, so:

c.FileHandler("/index.html", "/www/data/index.html")

Returns the content of the file "/www/data/index.html" when requests are sent to "/index.html" and:

c.FileHandler("/assets/*filepath", "/www/data/assets")

returns the content of the file "/www/data/assets/x/y/z" when requests are sent to "/assets/x/y/z".

FileHandler is referenced in 1 repository

github.com/goadesign/goa