A useful gas that used to manage the Accept-Language header for the web applications built using Air.
Open your terminal and execute
$ go get github.com/air-gases/langman
done.
The only requirement is the Go, at least v1.13.
Create a file named main.go
package main
import (
"github.com/air-gases/langman"
"github.com/aofei/air"
)
func main() {
a := air.Default
a.DebugMode = true
a.GET("/", func(req *air.Request, res *air.Response) error {
return res.WriteString(req.Header.Get("Accept-Language"))
}, langman.Gas(langman.GasConfig{}))
a.Serve()
}
and run it
$ go run main.go
then visit http://localhost:8080/?accept-language=en-US
.
If you want to discuss Langman, or ask questions about it, simply post questions or ideas here.
If you want to help build Langman, simply follow this to send pull requests here.
This project is licensed under the MIT License.
License can be found here.