router 404 when using app.StaticEmbedded
my code
app.StaticEmbedded("/", "static", Asset, AssetNames)
when routing localhost:8080 404 not found bug code iris/core/router/fs.go line 71
if path == "/index.html" && reqPath == "/" {
reqPath = "/index.html"
}
path is allways hax prefix "static" and path == "/index.html" is false all the time resolve by change code to
if reqPath == "" || reqPath == "/" {
reqPath = "/index.html"
}
another problem at iris/core/router/fs.go line 75 , + make the seperate error
if dpath != vdir + reqPath {
continue
}
resolve by change code to
if dpath != path.Join(vdir, reqPath) {
continue
}
You don't use the StaticEmbedded correct, this is why you get these errors, please read the examples at least before post an issue or give us a full code snippet in order to work on.
my code is as same as the examples , only change is folder name , but not running correct this is the full code
func main() {
app := iris.New()
app.Use(recover.New())
app.Use(logger.New())
app.StaticEmbedded("/", "./static", Asset, AssetNames)
app.Run(iris.Addr(":8054"))
}
go-bindata command
go-bindata -o bindata.go ./static/...
static file
static\
index.html
lib\
index.js
@xkylsoft Thank you for the report, sorry for the delay I have some other priorities this week, I just fixed it, just upgrade with go get -u github.com/kataras/iris and you should be fine, tell me the results :)