https://router.vuejs.org/en/essentials/history-mode.html
How do you solve vue.js HTML5 History Mode?
@boneq As the vuejs docs say, returning the index.html
of your web app when no other route is matched, is the way to go. It can ve achieved like below:
r.Use(static.Serve("/", static.LocalFile("/src", false)))
r.NoRoute(func(c *gin.Context){
c.File("/src/index.html")
})
PD: static is the middleware from https://github.com/gin-contrib/static
OK, I'll try it
Most helpful comment
@boneq As the vuejs docs say, returning the
index.html
of your web app when no other route is matched, is the way to go. It can ve achieved like below: