mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 21:06:39 +08:00
Add support HTML5 history API and push state
This commit is contained in:
parent
5caaac4c5c
commit
bbf588feaf
11
README.md
11
README.md
@ -708,3 +708,14 @@ endless.ListenAndServe(":4242", router)
|
||||
An alternative to endless:
|
||||
|
||||
* [manners](https://github.com/braintree/manners): A polite Go HTTP server that shuts down gracefully.
|
||||
|
||||
#### Support HTML5 history API and pushstate
|
||||
|
||||
```
|
||||
|
||||
r.NoRoute(func(c *gin.Context) {
|
||||
c.File("./dist/index.html") //Path to your /index.html template
|
||||
})
|
||||
```
|
||||
|
||||
This will using your /index.html template replace 404, similar as nginx rewrite rules and apache rewrite rules.
|
Loading…
x
Reference in New Issue
Block a user