Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remeh/go-webserver
Minimal, simple and powerful HTTP framework in Go. -- Old experimentation. You should use golang.org/pkg/net/http instead.
https://github.com/remeh/go-webserver
Last synced: about 1 month ago
JSON representation
Minimal, simple and powerful HTTP framework in Go. -- Old experimentation. You should use golang.org/pkg/net/http instead.
- Host: GitHub
- URL: https://github.com/remeh/go-webserver
- Owner: remeh
- Created: 2013-10-31T20:56:36.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-30T15:30:00.000Z (about 9 years ago)
- Last Synced: 2024-10-12T22:31:49.673Z (2 months ago)
- Language: Go
- Homepage:
- Size: 328 KB
- Stars: 4
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Deprecated: directly use https://golang.org/pkg/net/http instead!
remeh's go webserver
==Basic Go webserver used for [blurmbl.com](http://blurmbl.com), the [remy.io](http://remy.io) website and some others.
## Run the example
* 1st method: build an executable :`go build example/main.go && ./main`
* 2nd method: `go run example/main.go`## Features
* **Routing with regexp** : ex: GET ['/list/:id','/l/:id'] can send to an action GET which receives a parameter 'id',
* **Support go template** : to render pages in Go templates,
* **Reverse routing** : allows to rewrite routes directly in a template,
* **Assets support** : the directory assets is directly rendered without evaluation.## Roadmap
* **Use regexp only when needed** : route without parameters could be faster if no regexp were use for them.## How-to
### Get the package
To get the `webserver` package :
```
go get github.com/remeh/go-webserver
```You're now able to :
```
import "github.com/remeh/go-webserver"
```in your source code.
See `examples/main.go` and the content of `examples/site` for an example of usage.