* Add documentation for using mux to serve a SPA
* r -> router to prevent shadowing
* Expand SPA acronym
* BrowserRouter link
* Add more comments to explain how the spaHandler.ServeHTTP method works
* More sensical CORSMethodMiddleware
* Only sets Access-Control-Allow-Methods on valid preflight requests
* Does not return after setting the Access-Control-Allow-Methods header
* Does not append OPTIONS header to Access-Control-Allow-Methods
regardless of whether there is an OPTIONS method matcher
* Adds tests for the listed behavior
* Add example for CORSMethodMiddleware
* Do not check for preflight and add documentation to the README
* Use http.MethodOptions instead of "OPTIONS"
* Add link to CORSMethodMiddleware section to readme
* Add test for unmatching route methods
* Rename CORS Method Middleware to Handling CORS Requests in README
* Link CORSMethodMiddleware in README to godoc
* Break CORSMethodMiddleware doc into bullets for readability
* Add comment about specifying OPTIONS to example in README for CORSMethodMiddleware
* Document cURL command used for testing CORS Method Middleware
* Update comment in example to "Handle the request"
* Add explicit comment about OPTIONS matchers to CORSMethodMiddleware doc
* Update circleci config to only check gofmt diff on latest go version
* Break up gofmt and go vet checks into separate steps.
* Use canonical circleci config
The example in the README does not pass the request through a mux therefore the request variables from the path are never populated. Update the sample to create a minimum viable router to use.
Fixes#373
Prior to this change, the example documentation
found in the README.md has an errant code which
won't work in the table-driven code example.
This change modifies the variable name from `t` to `tc`
so it does not conflict with the `t *testing.T` struct
definition.
* Adds a range clause to the `for` statement
* Modifies `for` statement scope to use `tc.shouldPass`, and `tc.routeVariable`
Doc: https://github.com/gorilla/mux#testing-handlers
(this confused the heck out of me while trying to use Gorilla)
* Changed `request` to be just `r`, like the other handlers.
* Created complete wrapper function instead of just 2 lines.