Go-Mojito is a super-modular library to bootstrap your next Go web project. It can be used for strict API-only purposes as well as server-side rendering.
Icon made with Gopherize and flaticon.
⚡️ Quickstart
package main
import (
"github.com/infinytum/go-mojito"
"github.com/infinytum/go-mojito-fasthttp"
)
func main() {
// Register fasthttp as the default router.
fasthttp.AsDefault()
// Create your first route
mojito.GET("/", func(req mojito.Request, res mojito.Response) error {
res.String("Hello, World!")
return nil
})
// ListenAndServe the router
mojito.ListenAndServe(":8080")
}
🤖 Benchmarks
TODO
⚙️ Installation
- Make sure you have Go 1.18 or higher installed.
- Create a new folder and initialize your project with
go mod init github.com/your/project
.
- Install go-mojito with
go get -u github.com/infinytum/go-mojito
.
- Install go-mojito-fasthttp
go get -u github.com/infinytum/go-mojito-fasthttp