alpha: v0.0.1
This commit is contained in:
2
xtest/basic/basic.http
Normal file
2
xtest/basic/basic.http
Normal file
@ -0,0 +1,2 @@
|
||||
### basic - get
|
||||
GET http://127.0.0.1/hello/nf
|
17
xtest/basic/main.go
Normal file
17
xtest/basic/main.go
Normal file
@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/loveuer/nf"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := nf.New()
|
||||
|
||||
app.Get("/hello/:name", func(c *nf.Ctx) error {
|
||||
name := c.Param("name")
|
||||
return c.JSON(nf.Map{"status": 200, "data": "hello, " + name})
|
||||
})
|
||||
|
||||
log.Fatal(app.Run("0.0.0.0:80"))
|
||||
}
|
Reference in New Issue
Block a user