https://github.com/aisk/vox
Simple and lightweight Go web framework inspired by koa
https://github.com/aisk/vox
express go golang koa lightweight lightweight-framework sinatra web webframework
Last synced: 3 months ago
JSON representation
Simple and lightweight Go web framework inspired by koa
- Host: GitHub
- URL: https://github.com/aisk/vox
- Owner: aisk
- License: mit
- Created: 2014-12-24T11:22:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T04:57:26.000Z (over 2 years ago)
- Last Synced: 2024-12-26T19:51:22.572Z (4 months ago)
- Topics: express, go, golang, koa, lightweight, lightweight-framework, sinatra, web, webframework
- Language: Go
- Homepage: https://aisk.github.io/vox/
- Size: 76.2 KB
- Stars: 84
- Watchers: 4
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - vox - Go web framework inspired by koa - ★ 11 (Web Frameworks)
- awesome-go-extra - vox - 12-24T11:22:08Z|2021-05-31T16:20:33Z| (Web Frameworks / Fail injection)
README
# VOX
[](https://pkg.go.dev/github.com/aisk/vox)
[](https://travis-ci.org/aisk/vox)
[](https://codecov.io/gh/aisk/vox)
[](https://goreportcard.com/report/github.com/aisk/vox)
[](https://codeclimate.com/github/aisk/vox/maintainability)
[](https://gitter.im/go-vox/Lobby)A golang web framework for humans, inspired by [Koa](http://koajs.com) heavily.

## Getting started
### Installation
Using the `go get` power:
```sh
$ go get -u github.com/aisk/vox
```### Basic Web Application
```go
package mainimport (
"fmt"
"time""github.com/aisk/vox"
)func main() {
app := vox.New()// custom middleware that add a x-response-time to the response header
app.Use(func(ctx *vox.Context, req *vox.Request, res *vox.Response) {
start := time.Now()
ctx.Next()
duration := time.Now().Sub(start)
res.Header.Set("X-Response-Time", fmt.Sprintf("%s", duration))
})// router param
app.Get("/hello/{name}", func(ctx *vox.Context, req *vox.Request, res *vox.Response) {
res.Body = "Hello, " + req.Params["name"] + "!"
})app.Run("localhost:3000")
}
```## More Docs
https://aisk.github.io/vox/
## Need Support?
If you need help for using vox, or have other questions, welcome to our [gitter chat room](https://gitter.im/go-vox/Lobby).
## About the Project
Vox is © 2016-2020 by [aisk](https://github.com/aisk).
### License
Vox is distributed by a [MIT license](https://github.com/aisk/vox/tree/master/LICENSE).