Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 656 Bytes

README.md

File metadata and controls

47 lines (32 loc) · 656 Bytes

goal

go web framework

Installation

go get github.com/xushuhui/goal

Example

package main

import (
    "net/http"
    "github.com/xushuhui/goal"
 
)

func main() {
	r := goal.Default()

	r.GET("/", func(c *Context) error {
		c.HTML(http.StatusOK, "<h1>Hello World</h1>")
		return nil
	})
	r.GET("/hello", func(c *Context) error {

		c.String(http.StatusOK, "hello %s, you're at %s\n", c.Query("name"), c.Path)
		return nil
	})
    r.Run(":8000")
}

RoadMap

  • bind
  • logging

微信公众号

扫码关注