python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
How to log the HTTP return code with the chi router?
I use chi as my router and wrote a simple middleware that logs the request being made:
func logCalls(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.R...
WoJ
Votes: 0
Answers: 1
How are static files served through .Handle() targeted?
EDIT: I am usinng chi as the router. It works differently from the standard one. See the answer for the key difference, relevant to my question.
I am confused about how the files from my static site s...
WoJ
Votes: 0
Answers: 1
How to use a middleware for a specific route, among other ones?
My simplified routing is similar to
r.Route("/api/v1", func(r chi.Router) {
r.Route("/case", func(r chi.Router) {
// generic case - for everyone
r.G...
WoJ
Votes: 0
Answers: 1
Cant add Contex Value with Chi from interface
i have data from interface, and i will add on context. from documentation is context.WithValue(r.Context(), key, val)
i try to add 1 key and value is work, but can't work if more than 1.
resul...
Arif Aminudin
Votes: 0
Answers: 2