We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
app.Get("/user/:id", func(c *baa.Context) { c.String(200, " user id is: " + c.Param("id")) })
The text was updated successfully, but these errors were encountered:
if you want match the lash slash, please use
app.SetAutoTrailingSlash(true)
please view document:
https://github.com/go-baa/doc/blob/master/zh-CN/router.md#路由选项
Sorry, something went wrong.
@safeie app.SetAutoTrailingSlash(true) [log] GET /user/100/ 200 0s [log] GET /user/100 200 0s [log] GET /user/ 200 0s
app.SetAutoTrailingSlash(false)
[log] GET /user/ 200 0s [log] GET /user/100 200 0s [log] GET /user/100/ 404 0s
expect like net/http
package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/user/100", func (w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Welcome to my website!") }) http.ListenAndServe(":80", nil) }
$curl http://localhost:80/user/ 404 page not found
$ curl http://localhost:80/user/100 Welcome to my website! $ curl http://localhost:80/user/100/ 404 page not found
Fix github issue url /user/ match "/user/:id" #5
f8d7acb
No branches or pull requests
The text was updated successfully, but these errors were encountered: