Comments (1)
You'll need to specifically send a request through a Goji Mux
in order to run Goji's routing logic. If Goji's routing logic doesn't run, it can't match its patterns against the input URL, and can't extract bound variables from the pattern (via e.g., pat.Param
).
Try writing the following:
func mux() *goji.Mux {
mux := goji.NewMux()
mux.HandleFunc(pat.Get("/hello/:name"), hello)
return mux
}
func main() {
http.ListenAndServe("localhost:8000", mux())
}
And in your test, write s := httptest.NewServer(mux())
from goji.
Related Issues (20)
- Problem in running goji "Hello World" HOT 2
- How to get all request parameters in handler?
- Please tag/release the 1.7+ master branch HOT 1
- middleware.Handler(rq.Context()) returns nil HOT 1
- Can't install goji HOT 3
- Missing Object.assing method HOT 1
- Cannot install using glide or gb HOT 7
- go get issue HOT 2
- dispatch.go:6:2: use of internal package not allowed HOT 1
- Rate Limit HOT 1
- Handling application panics and serving a 500 error page HOT 2
- Could pat.Param not panic when it the interface is nil HOT 4
- go modules support ? HOT 5
- [Proposal] consider making `newWithMethods` accessible function HOT 3
- git tags suggest v2, but go.mod disagrees HOT 4
- Nicer errors on requests? HOT 1
- Are patterns broken inside middleware? HOT 1
- how to HTTPS/TLS Web Server with goji ? HOT 1
- Is there a way to pass the regexp that was available in the old goji? HOT 2
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 goji.