web.go alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view web.go alternatives based on common mentions on social networks and blogs.
-
Gin
Gin is a web framework written in Go! It features a martini-like API with much better performance, up to 40 times faster. If you need performance and good productivity. -
Iris
High-performance golang web application framework, providing a robust set of features for building modern web applications. -
go-kit
A Microservice toolkit with support for service discovery, load balancing, pluggable transports, request tracking, etc. -
httprouter
A high performance router. Use this and the standard http handlers to form a very high performance web framework. -
Faygo
Faygo uses the new architecture to make itself the most suitable Go Web framework for developping API. Just define a struct Handler, Faygo will automatically bind, verify the request parameters and generate the online API documentation. -
REST Layer
A framework to build REST/GraphQL API on top of databases with mostly configuration over code. -
Goyave
Feature-complete web framework aimed at clean code and fast development, with powerful built-in functionalities. -
rye
Tiny Go middleware library (with canned Middlewares) that supports JWT, CORS, Statsd, and Go 1.7 context -
ozzo-routing
A high-performance HTTP router and Web framework supporting routes with regular expressions. Comes with full support for quickly building a RESTful API application.
Get performance insights in less than 4 minutes
Do you think we are missing an alternative of web.go or a related project?
Popular Comparisons
README
web.go
web.go is the simplest way to write web applications in the Go programming language. It's ideal for writing simple, performant backend web services.
Overview
web.go should be familiar to people who've developed websites with higher-level web frameworks like sinatra or web.py. It is designed to be a lightweight web framework that doesn't impose any scaffolding on the user. Some features include:
- Routing to url handlers based on regular expressions
- Secure cookies
- Support for fastcgi and scgi
- Web applications are compiled to native code. This means very fast execution and page render speed
- Efficiently serving static files
Installation
Make sure you have the a working Go environment. See the install instructions. web.go targets the Go release
branch.
To install web.go, simply run:
go get github.com/hoisie/web
To compile it from source:
git clone git://github.com/hoisie/web.git
cd web && go build
Example
package main
import (
"github.com/hoisie/web"
)
func hello(val string) string { return "hello " + val }
func main() {
web.Get("/(.*)", hello)
web.Run("0.0.0.0:9999")
}
To run the application, put the code in a file called hello.go and run:
go run hello.go
You can point your browser to http://localhost:9999/world .
Getting parameters
Route handlers may contain a pointer to web.Context as their first parameter. This variable serves many purposes -- it contains information about the request, and it provides methods to control the http connection. For instance, to iterate over the web parameters, either from the URL of a GET request, or the form data of a POST request, you can access ctx.Params
, which is a map[string]string
:
package main
import (
"github.com/hoisie/web"
)
func hello(ctx *web.Context, val string) {
for k,v := range ctx.Params {
println(k, v)
}
}
func main() {
web.Get("/(.*)", hello)
web.Run("0.0.0.0:9999")
}
In this example, if you visit http://localhost:9999/?a=1&b=2
, you'll see the following printed out in the terminal:
a 1
b 2
Documentation
API docs are hosted at https://hoisie.github.io/web/
If you use web.go, I'd greatly appreciate a quick message about what you're building with it. This will help me get a sense of usage patterns, and helps me focus development efforts on features that people will actually use.
About
web.go was written by Michael Hoisie