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 ( "github.com/henrylee2cn/faygo" "time" ) type Index struct { } func (i *Index) Serve(ctx *faygo.Context) error { if ctx.CookieParam("faygoID") == "" { ctx.SetCookie("faygoID", time.Now().String()) } return ctx.JSON(200, i) } func main() { app := faygo.New("myapp", "0.1") app.GET("/index/:id", new(Index)) faygo.Run() //8080 } ``` $ curl http://localhost:8080/index/100/ <a href="/index/100">Moved Permanently</a>. ``` package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/hello/aa", func (w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Welcome to my website!") }) http.ListenAndServe(":80", nil) } ``` $ curl http://localhost:8080/index/100/ 404 page not found
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: