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

How do you solve vue.js HTML5 History Mode? #1048

Closed
boneq opened this issue Jul 31, 2017 · 3 comments
Closed

How do you solve vue.js HTML5 History Mode? #1048

boneq opened this issue Jul 31, 2017 · 3 comments
Labels

Comments

@boneq
Copy link

boneq commented Jul 31, 2017

https://router.vuejs.org/en/essentials/history-mode.html

How do you solve vue.js HTML5 History Mode?

@javierprovecho
Copy link
Member

@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")
})

@javierprovecho
Copy link
Member

PD: static is the middleware from https://github.com/gin-contrib/static

@boneq
Copy link
Author

boneq commented Aug 3, 2017

OK, I'll try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants