Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Didstopia/tinyserver
A blazing fast and lightweight web server for Go.
https://github.com/Didstopia/tinyserver
Last synced: about 1 month ago
JSON representation
A blazing fast and lightweight web server for Go.
- Host: GitHub
- URL: https://github.com/Didstopia/tinyserver
- Owner: Didstopia
- License: mit
- Created: 2018-12-28T08:09:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-24T11:09:05.000Z (over 5 years ago)
- Last Synced: 2024-08-02T05:12:17.895Z (4 months ago)
- Language: Go
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-blazingly-fast - tinyserver - A blazing fast and lightweight web server for Go. (Go)
README
[![Build Status](https://travis-ci.org/Didstopia/tinyserver.svg?branch=master)](https://travis-ci.org/Didstopia/tinyserver)
[![codecov](https://codecov.io/gh/Didstopia/tinyserver/branch/master/graph/badge.svg)](https://codecov.io/gh/Didstopia/tinyserver)# 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
```sh
go get -u github.com/Didstopia/tinyserver
```## Usage
```go
package mainimport (
"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](LICENSE).