Skip to content
/ slim Public

Slim is a fork of Goji, a minimalistic web framework for Golang

License

Notifications You must be signed in to change notification settings

vanackere/slim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slim

GoDoc Build Status

Slim is a fork of Goji, a minimalistic web framework that values composability and simplicity.

Differences with Goji

func(ctx context.Context, w http.ResponseWriter, r *http.Request, next web.Handler)

Example

package main

import (
        "fmt"
        "net/http"

        "code.google.com/p/go.net/context"
        "github.com/vanackere/slim"
        "github.com/vanackere/slim/web"
)

func hello(ctx context.Context, w http.ResponseWriter, r *http.Request) {
        p := web.URLParams(ctx)
        fmt.Fprintf(w, "Hello, %s!", p["name"])
}

func main() {
        slim.Get("/hello/:name", hello)
        slim.Serve()
}

Slim also includes a sample application in the example folder which was artificially constructed to show off all of Slim's features. Check it out!

Features

  • Fork of the excellent Goji framework
  • Compatible with net/http
  • URL patterns (both Sinatra style /foo/:bar patterns and regular expressions, as well as custom patterns)
  • Reconfigurable middleware stack
  • Context/environment object threaded through middleware and handlers
  • Context is the one from "code.google.com/p/go.net/context" (see here for an introduction)
  • Automatic support for Einhorn, systemd, and more
  • Graceful shutdown, and zero-downtime graceful reload when combined with Einhorn.

See Goji's README for why Goji's - and therore Slim's ! - approach is good.

About

Slim is a fork of Goji, a minimalistic web framework for Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages