22 lines
267 B
Go
22 lines
267 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
"log"
|
||
|
"nf"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
app := nf.New()
|
||
|
|
||
|
app.Get("/hello", func(c *nf.Ctx) error {
|
||
|
return c.SendString("world")
|
||
|
})
|
||
|
|
||
|
app.Get("/world", func(c *nf.Ctx) error {
|
||
|
return errors.New("nice")
|
||
|
})
|
||
|
|
||
|
log.Fatal(app.Run(":7733"))
|
||
|
}
|