mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
PushTargetsRegexp: take advantage of the AssetNames on embedded file system
rel to: https://github.com/kataras/iris/issues/1562#issuecomment-660415246 Former-commit-id: 9e3fb4d71e14dda025a3af86cf210ff72127b716
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
@@ -16,13 +18,9 @@ import (
|
||||
|
||||
var opts = iris.DirOptions{
|
||||
IndexName: "/index.html",
|
||||
PushTargets: map[string][]string{
|
||||
"/": { // Relative path without route prefix.
|
||||
"favicon.ico",
|
||||
"js/main.js",
|
||||
"css/main.css",
|
||||
// ^ Relative to the index, if need absolute ones start with a slash ('/').
|
||||
},
|
||||
PushTargetsRegexp: map[string]*regexp.Regexp{
|
||||
"/": iris.MatchCommonAssets,
|
||||
"/app2/app2app3": iris.MatchCommonAssets,
|
||||
},
|
||||
Compress: false,
|
||||
ShowList: true,
|
||||
|
||||
Reference in New Issue
Block a user