Koa styled web framework written in Go.
Read this in other languages: English | 简体中文
- Introduction
- Prerequisites
- Installation
- Quick Start
- What Are NOT Implemented
- Documentation
- Development
GoKoa is a Koa styled web framework, which aims at reducing learning cost in grasping web development in Go for Node.js developers.
GoKoa is written in Go, which is beneficial to improving performance in handling HTTP requests.
- Go >= 1.13
You can easily fetch the newest version of GoKoa by executing go get
:
$ go get github.com/xiaojianzhong/gokoa
package main
import (
"github.com/xiaojianzhong/gokoa"
)
func main() {
app := gokoa.NewApplication(nil)
app.Use(func(ctx *gokoa.Context, fn func() error) error {
ctx.SetBody("hello gokoa")
return nil
})
app.Listen(8080)
}
- lack of event emitting, except for
app.OnError()
- not able to customize HTTP reason phrase (don't do that cause it breaks the best practice)
- not able to bypass GoKoa's response handling (actually it is deprecated by Koa, too)
- not able to access the socket related to a HTTP connection
- lack of
headerSent
property
You can easily run unit tests by executing go test
:
$ go test github.com/xiaojianzhong/gokoa