You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**The Gorilla project has been archived, and is no longer under active maintainenance. You can read more here: https://github.com/gorilla#gorilla-toolkit**
11
+
Just a fork of the https://github.com/gorilla/mux project since it is archived. Who knows what might come in handy?
12
12
13
13
---
14
14
@@ -45,7 +45,7 @@ The name mux stands for "HTTP request multiplexer". Like the standard `http.Serv
45
45
With a [correctly configured](https://golang.org/doc/install#testing) Go toolchain:
46
46
47
47
```sh
48
-
go get -u github.com/gorilla/mux
48
+
go get -u github.com/vaguecoder/gorilla-mux
49
49
```
50
50
51
51
## Examples
@@ -234,7 +234,7 @@ import (
234
234
"path/filepath"
235
235
"time"
236
236
237
-
"github.com/gorilla/mux"
237
+
mux "github.com/vaguecoder/gorilla-mux"
238
238
)
239
239
240
240
// spaHandler implements the http.Handler interface, so we can use it
@@ -392,7 +392,7 @@ import (
392
392
"net/http"
393
393
"strings"
394
394
395
-
"github.com/gorilla/mux"
395
+
mux "github.com/vaguecoder/gorilla-mux"
396
396
)
397
397
398
398
funchandler(whttp.ResponseWriter, r *http.Request) {
@@ -455,7 +455,7 @@ import (
455
455
"os/signal"
456
456
"time"
457
457
458
-
"github.com/gorilla/mux"
458
+
mux "github.com/vaguecoder/gorilla-mux"
459
459
)
460
460
461
461
funcmain() {
@@ -506,7 +506,7 @@ func main() {
506
506
507
507
### Middleware
508
508
509
-
Mux supports the addition of middlewares to a [Router](https://godoc.org/github.com/gorilla/mux#Router), which are executed in the order they are added if a match is found, including its subrouters.
509
+
Mux supports the addition of middlewares to a [Router](https://godoc.org/github.com/vaguecoder/gorilla-mux#Router), which are executed in the order they are added if a match is found, including its subrouters.
510
510
Middlewares are (typically) small pieces of code which take one request, do something with it, and pass it down to another middleware or the final handler. Some common use cases for middleware are request logging, header manipulation, or `ResponseWriter` hijacking.
511
511
512
512
Mux middlewares are defined using the de facto standard type:
@@ -586,7 +586,7 @@ Note: The handler chain will be stopped if your middleware doesn't call `next.Se
586
586
587
587
### Handling CORS Requests
588
588
589
-
[CORSMethodMiddleware](https://godoc.org/github.com/gorilla/mux#CORSMethodMiddleware) intends to make it easier to strictly set the `Access-Control-Allow-Methods` response header.
589
+
[CORSMethodMiddleware](https://godoc.org/github.com/vaguecoder/gorilla-mux#CORSMethodMiddleware) intends to make it easier to strictly set the `Access-Control-Allow-Methods` response header.
590
590
591
591
* You will still need to use your own CORS handler to set the other CORS headers such as `Access-Control-Allow-Origin`
592
592
* The middleware will set the `Access-Control-Allow-Methods` header to all the method matchers (e.g. `r.Methods(http.MethodGet, http.MethodPut, http.MethodOptions)` -> `Access-Control-Allow-Methods: GET,PUT,OPTIONS`) on a route
@@ -600,7 +600,7 @@ package main
600
600
601
601
import (
602
602
"net/http"
603
-
"github.com/gorilla/mux"
603
+
mux "github.com/vaguecoder/gorilla-mux"
604
604
)
605
605
606
606
funcmain() {
@@ -787,7 +787,7 @@ package main
787
787
import (
788
788
"net/http"
789
789
"log"
790
-
"github.com/gorilla/mux"
790
+
mux "github.com/vaguecoder/gorilla-mux"
791
791
)
792
792
793
793
func YourHandler(w http.ResponseWriter, r *http.Request) {
0 commit comments