Skip to content

Everytime refresh it redirect to root not the current path? #55

@needhourger

Description

@needhourger

I am using gin-static to host vue3 app.
Here is my code:

func initStatics(engine *gin.Engine) {
	engine.Use(static.Serve("/", static.EmbedFolder(embedFs.Embed, "dist")))
	engine.NoRoute(func(ctx *gin.Context) {
		ctx.Redirect(http.StatusMovedPermanently, "/")
	})
}

func InitGinEngine() *gin.Engine {
	engine := gin.Default()

	jwtMiddleware := middleware.InitJWTMiddleware()
	initRouter(engine, jwtMiddleware)
	initStatics(engine)

	return engine
}

every time I refresh the page, it just redirect to the root path? Is there any way to make it loading correct path?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions