(path string, notfound []string)
| 56 | } |
| 57 | |
| 58 | func newFilesystemEndpoint(path string, notfound []string) (*filesystemEndpoint, error) { |
| 59 | rparts := []routespec.RouteSpec{} |
| 60 | for _, p := range notfound { |
| 61 | rp, err := routespec.ParseRouteSpec(p) |
| 62 | if err != nil { |
| 63 | return nil, err |
| 64 | } |
| 65 | if rp.IsURL { |
| 66 | return nil, fmt.Errorf("Not found over-ride target cannot be a URL.") |
| 67 | } |
| 68 | rparts = append(rparts, *rp) |
| 69 | } |
| 70 | return &filesystemEndpoint{path, rparts}, nil |
| 71 | } |
| 72 | |
| 73 | func (ep filesystemEndpoint) Handler(prefix string, templates *template.Template, ci inject.CopyInject) httpctx.Handler { |
| 74 | return &fileserver.FileServer{ |
no outgoing calls