https://github.com/xiaojianzhong/gokoa
Koa styled web framework written in Go.
https://github.com/xiaojianzhong/gokoa
golang koa nodejs webframework
Last synced: about 2 months ago
JSON representation
Koa styled web framework written in Go.
- Host: GitHub
- URL: https://github.com/xiaojianzhong/gokoa
- Owner: xiaojianzhong
- License: mit
- Created: 2020-02-28T16:50:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-24T17:18:46.000Z (about 4 years ago)
- Last Synced: 2026-04-19T14:46:11.750Z (2 months ago)
- Topics: golang, koa, nodejs, webframework
- Language: Go
- Homepage: https://pkg.go.dev/github.com/xiaojianzhong/gokoa
- Size: 45.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# GoKoa




[Koa][koa] styled web framework written in Go.
Read this in other languages: English | [简体中文](./README_zh-CN.md)
## Table of Contents
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [What Are NOT Implemented](#what-are-not-implemented)
- [Documentation](#documentation)
- [`Application`](#application)
- [`Context`](#context)
- [`Request`](#request)
- [`Response`](#response)
- [Development](#development)
- [How to Test](#how-to-test)
[GoKoa](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.
1. [Go](go) >= 1.13
You can easily fetch the newest version of GoKoa by executing `go get`:
```bash
$ go get github.com/xiaojianzhong/gokoa
```
```go
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)
}
```
1. lack of event emitting, except for `app.OnError()`
2. not able to customize HTTP reason phrase (don't do that cause it breaks the best practice)
3. not able to bypass GoKoa's response handling (actually it is deprecated by Koa, too)
4. not able to access the socket related to a HTTP connection
5. lack of `headerSent` property
You can easily run unit tests by executing `go test`:
```bash
$ go test github.com/xiaojianzhong/gokoa
```
[koa]: https://github.com/koajs/koa
[go]: https://golang.org/
[gokoa]: https://github.com/xiaojianzhong/gokoa