1
0
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:
Gerasimos (Makis) Maropoulos
2020-07-18 07:51:36 +03:00
parent 552f990358
commit e16abc96c6
6 changed files with 157 additions and 44 deletions

View File

@@ -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,