A small web framework
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
components
examples
futures
iongae
middleware
scripts
.gitignore
.travis.yml
LICENSE
README.md
ion.go

README.md

Ion Web Framework

GoDoc Build Status codecov Go Report Card

Ion is a small web framework written in Go.

Ion leverages component composition to allow functionality reuse, and build complex behaviors based on simple components.

A short example:

package main

import (
    "fmt"
    "github.com/estebarb/ion"
    "github.com/estebarb/ion/components/router"
    "net/http"
)

func hello(w http.ResponseWriter, r *http.Request) {
    context := ion.App.Context(r)
    params := context.(router.IPathParam)
    value, exists := params.PathParams()["name"]
    if exists {
        fmt.Fprintf(w, "Hello, %v!", value)
    } else {
        fmt.Fprint(w, "Hello world!")
    }
}

func main() {
    ion.GetFunc("/", hello)
    ion.GetFunc("/:name", hello)
    http.ListenAndServe(":5500", ion.App)
}

At this point the framework is highly experimental, so please take that in consideration if you want to use it.

License

Ion is released under the MIT License, as specified in LICENSE.