Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
needhourger opened this issue Jul 8, 2024 · 0 comments
Open

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

needhourger opened this issue Jul 8, 2024 · 0 comments

Comments

@needhourger
Copy link

needhourger commented Jul 8, 2024

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?

@needhourger needhourger changed the title Firefox: The stylesheet http://localhost:8080/ was not loaded because its MIME type, “text/html”, is not “text/css”. Everytime refresh it redirect to root not the current path? Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant