/goserv

A lightweight toolkit for web applications in Go

Primary LanguageGoBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

goserv

GoServ

A fast, easy and minimalistic framework for web applications in Go.

goserv requires at least Go v1.6.0

GoDoc Build Status

package main

import (
	"github.com/gotschmarcel/goserv"
	"net/http"
	"log"
)

func main() {
	server := goserv.NewServer()
	server.Get("/", func (w http.ResponseWriter, r *http.Request) {
		goserv.WriteString(w, "Welcome Home")
	}
	log.Fatalln(server.Listen(":12345"))
}

Installation

$ go get github.com/gotschmarcel/goserv

Features

  • Fully compatible with net/http
  • Robust and fast routing
  • Middleware handlers
  • Nested routers
  • Request context
  • URL parameters
  • Response and request helpers
  • Centralized error handling

Examples

Examples can be found in example_test.go

License

BSD licensed. See the LICENSE file for more information.