We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main import ( "fmt" "github.com/kn9ts/frodo" "net/http" ) func one(w http.ResponseWriter, r *frodo.Request) { fmt.Println("Hello, am the 1st middleware!") } func main() { app := frodo.New() app.RedirectTrailingSlash = false app.Get("/hello/:name", one) app.Serve() //3102 }
$ curl -v http://localhost:3102/hello/ HTTP/1.1 200 OK Content-Length: 0
$ curl -v http://localhost:3102/hello/frodo/ HTTP/1.1 200 OK Content-Length: 0
package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/hello/frodo", func (w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Welcome to my website!") }) http.ListenAndServe(":3102", nil) }
$ curl -v http://localhost/hello/ HTTP/1.1 404 Not Found
$ curl -v http://localhost/hello/frodo/ HTTP/1.1 404 Not Found
The text was updated successfully, but these errors were encountered:
No branches or pull requests
$ curl -v http://localhost:3102/hello/
HTTP/1.1 200 OK
Content-Length: 0
$ curl -v http://localhost:3102/hello/frodo/
HTTP/1.1 200 OK
Content-Length: 0
$ curl -v http://localhost/hello/
HTTP/1.1 404 Not Found
$ curl -v http://localhost/hello/frodo/
HTTP/1.1 404 Not Found
The text was updated successfully, but these errors were encountered: