1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

Modify the SPA example for iris.PrefixDir

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-14 18:36:04 +03:00
parent 076f806925
commit 44d5ebdc9c
9 changed files with 102 additions and 81 deletions

View File

@@ -232,6 +232,14 @@ var (
// PrefixDir returns a new FileSystem that opens files
// by adding the given "prefix" to the directory tree of "fs".
//
// Useful when having templates and static files in the same
// bindata AssetFile method. This way you can select
// which one to serve as static files and what for templates.
// All view engines have a `RootDir` method for that reason too
// but alternatively, you can wrap the given file system with this `PrefixDir`.
//
// Example: https://github.com/kataras/iris/blob/master/_examples/file-server/single-page-application/embedded-single-page-application/main.go
func PrefixDir(prefix string, fs http.FileSystem) http.FileSystem {
return &prefixedDir{prefix, fs}
}