Comments (5)
There is Otherwise mathod on your demand
from trie-mux.
It can't support implicit matching.
You should define router.Get("/a", handler)
from trie-mux.
In my opinion, simple pattern take precedence over named pattern, /a
conflict with /:a
, if both of them exist, maybe there should be a panic.
There is other situation
package main
import (
"net/http"
"github.com/teambition/trie-mux/mux"
)
func main() {
router := mux.New()
router.Get("/a/b", func(w http.ResponseWriter, _ *http.Request, _ mux.Params) {
w.Write([]byte("hello world!\n"))
})
router.Get("/:name/b", func(w http.ResponseWriter, _ *http.Request, _ mux.Params) {
w.Write([]byte("index\n"))
})
http.ListenAndServe(":8080", router)
}
/a/b
is conflict with /:name/b
, path /b/b
match /:name/b
, but it's difficult to find the conflict between them, i can't solve this, so i post a issue.
from trie-mux.
Currently it is enough for practice usage with high performance. Don't make logic intricacy.
from trie-mux.
Yes, beyond is as wrong as falling short.
from trie-mux.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trie-mux.