🔴 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