mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
e16abc96c6
rel to: https://github.com/kataras/iris/issues/1562#issuecomment-660415246 Former-commit-id: 9e3fb4d71e14dda025a3af86cf210ff72127b716
38 lines
901 B
Go
38 lines
901 B
Go
package main
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/kataras/iris/v12"
|
|
)
|
|
|
|
// Follow the steps below:
|
|
// $ go get -u github.com/go-bindata/go-bindata/...
|
|
//
|
|
// $ go-bindata -nomemcopy -prefix "../http2push/" ../http2push/assets/...
|
|
// # OR if the ./assets directory was inside this example foder:
|
|
// # go-bindata -nomemcopy ./assets/...
|
|
//
|
|
// $ go run .
|
|
// Physical files are not used, you can delete the "assets" folder and run the example.
|
|
|
|
var opts = iris.DirOptions{
|
|
IndexName: "/index.html",
|
|
PushTargetsRegexp: map[string]*regexp.Regexp{
|
|
"/": iris.MatchCommonAssets,
|
|
"/app2/app2app3": iris.MatchCommonAssets,
|
|
},
|
|
Compress: false,
|
|
ShowList: true,
|
|
Asset: Asset,
|
|
AssetInfo: AssetInfo,
|
|
AssetNames: AssetNames,
|
|
}
|
|
|
|
func main() {
|
|
app := iris.New()
|
|
app.HandleDir("/public", "./assets", opts)
|
|
|
|
app.Run(iris.TLS(":443", "../http2push/mycert.crt", "../http2push/mykey.key"))
|
|
}
|