mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
New DirOptions.Cache field for in-memory caching and pre-compression for the fastest possible static file server
Read HISTORY.md it contains a breaking change, second parameter of HandleDir should be iris.Dir(...) instead of just a string relative to: https://github.com/kataras/iris/issues/1556#issuecomment-661057446 Former-commit-id: 14b48a06fb3b99287dff543932be2937a64233b9
This commit is contained in:
@@ -18,7 +18,7 @@ func main() {
|
||||
|
||||
app.RegisterView(iris.HTML("./views", ".html").Layout("shared/layout.html"))
|
||||
|
||||
app.HandleDir("/public", "./public")
|
||||
app.HandleDir("/public", iris.Dir("./public"))
|
||||
|
||||
userRouter := app.Party("/user")
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ func main() {
|
||||
Reload(true)
|
||||
app.RegisterView(tmpl)
|
||||
|
||||
app.HandleDir("/public", "./web/public")
|
||||
app.HandleDir("/public", iris.Dir("./web/public"))
|
||||
|
||||
app.OnAnyErrorCode(func(ctx iris.Context) {
|
||||
ctx.ViewData("Message", ctx.Values().
|
||||
|
||||
@@ -517,7 +517,7 @@ func main() {
|
||||
// no need for any server-side template here,
|
||||
// actually if you're going to just use vue without any
|
||||
// back-end services, you can just stop afer this line and start the server.
|
||||
app.HandleDir("/", "./public")
|
||||
app.HandleDir("/", iris.Dir("./public"))
|
||||
|
||||
// configure the http sessions.
|
||||
sess := sessions.New(sessions.Config{
|
||||
|
||||
@@ -20,7 +20,7 @@ func main() {
|
||||
// no need for any server-side template here,
|
||||
// actually if you're going to just use vue without any
|
||||
// back-end services, you can just stop afer this line and start the server.
|
||||
app.HandleDir("/", "./public")
|
||||
app.HandleDir("/", iris.Dir("./public"))
|
||||
|
||||
// configure the http sessions.
|
||||
sess := sessions.New(sessions.Config{
|
||||
|
||||
@@ -17,7 +17,7 @@ func main() {
|
||||
// app.RegisterView(iris.HTML("./views", ".html"))
|
||||
|
||||
// render the ./browser/index.html.
|
||||
app.HandleDir("/", "./browser")
|
||||
app.HandleDir("/", iris.Dir("./browser"))
|
||||
|
||||
websocketAPI := app.Party("/websocket")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user