Skip to content

A blazing fast and lightweight web server for Go.

License

Notifications You must be signed in to change notification settings

Didstopia/tinyserver

Repository files navigation

Build Status codecov

tinyserver

A web server for Go, with the primary purpose of being small, fast and extremely light on resources.

WARNING: Work in progress, do not use in production yet!

Installation

go get -u github.com/Didstopia/tinyserver

Usage

package main

import (
  "github.com/Didstopia/tinyserver"
)

func main() {
  // Create a new server
  server, err := NewServer()
  if err != nil { panic(err) }

  // Create a new route
  route := func(w http.ResponseWriter, r *http.Request) { w.Write("Hello World!") }
  if err = server.AddRoute("/route", route); err != nil { panic(err) }

  // Start the server, listening on port 8080
  // NOTE: You can also use "ListenAsync" to run the server asynchronously (non-blocking)
  if err = server.Listen("8080"); err != nil { panic(err) }
}

Benchmarks

TODO

License

See LICENSE.

About

A blazing fast and lightweight web server for Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published