π΄ This library is actually well tested but the API may change with the time introducing breaking changes
π This is a micro-framework / router built on β¬ top of the fasthttp package. Alf relies on scalability and his simple structure wich is similar to Flutter projects π΄
β¨ Inspired by Flutter & Fiber
π·ββοΈ Make a router to start faster and simpler my backend projects
π Learn
- Explore the fasthttp package β
- Publish my own package π¦
- Learn more deeply how a web server works π
- Go (Golang)
- Fast Router π¨
- Concurrent Route Setup β
- Send JSON Responses (docs)
- HTML/Go Templates Out of the BOX β¨ (docs)
- Plugins 𧩠:
- Generate Types for TS (tygo pkg) (docs)
Download the package β¬
go get github.com/PiterWeb/Alf-Router
Import it into your code π
import (
alf "github.com/PiterWeb/Alf-Router"
)
Write this simple structure
err := alf.App(&alf.AppConfig{
Port: "3000",
Routes: alf.CreateRouter([]alf.Route{
{
Path: "/",
Handle: func(ctx *alf.Ctx) error {
_, err := ctx.WriteString("Hello World")
return err
},
Method: "get",
},
}),
})
if err != nil {
panic(err)
}
Now you have setup π¨ an index route