8000 GitHub - xiaojianzhong/gokoa: Koa styled web framework written in Go.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

xiaojianzhong/gokoa

Repository files navigation

GoKoa

GitHub Workflow Status GitHub repo size GitHub last commit GitHub

Koa styled web framework written in Go.

Read this in other languages: English | 简体中文

Table of Contents

Introduction

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.

Prerequisites

  1. Go >= 1.13

Installation

You can easily fetch the newest version of GoKoa by executing go get:

$ go get github.com/xiaojianzhong/gokoa

Quick Start

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)
}

What Are NOT Implemented

  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

Documentation

Application

Context

Request

Response

Development

How To Test

You can easily run unit tests by executing go test:

$ go test github.com/xiaojianzhong/gokoa

About

Koa styled web framework written in Go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0