mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
app. SPA from router wrapper to a simple handler, works faster now. Iris' router respects wildcards with other paths as well (unique) for almost a half year now... so we don't need a whole wrapper for those things anymore, fixes https://github.com/kataras/iris/issues/807
Former-commit-id: 5bd7f24997bb025a01bb92960a1bf255f073a228
This commit is contained in:
@@ -13,8 +13,7 @@ func newApp() *iris.Application {
|
||||
ctx.Writef("404 not found here")
|
||||
})
|
||||
|
||||
assetHandler := app.StaticEmbeddedHandler("./public", Asset, AssetNames)
|
||||
app.SPA(assetHandler)
|
||||
app.StaticEmbedded("/", "./public", Asset, AssetNames)
|
||||
|
||||
// Note:
|
||||
// if you want a dynamic index page then see the file-server/embedded-single-page-application
|
||||
|
||||
@@ -25,6 +25,8 @@ func newApp() *iris.Application {
|
||||
assetHandler := app.StaticEmbeddedHandler("./public", Asset, AssetNames)
|
||||
// as an alternative of SPA you can take a look at the /routing/dynamic-path/root-wildcard
|
||||
// example too
|
||||
// or
|
||||
// app.StaticEmbedded if you don't want to redirect on index.html and simple serve your SPA app (recommended).
|
||||
|
||||
// public/index.html is a dynamic view, it's handlded by root,
|
||||
// and we don't want to be visible as a raw data, so we will
|
||||
|
||||
Reference in New Issue
Block a user