forcedomain

package module
v0.0.0-...-b4c49ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2014 License: MIT Imports: 4 Imported by: 0

README

forcedomain wercker status

Martini middleware/handler for redirect based on environment variable.

Usage

Just add the middleware and run it with DOMAIN env set to your redirect url.

package main

import (
    "github.com/go-martini/martini"
    "github.com/mytrile/forcedomain"
)

func main() {
    m := martini.Classic()
    m.Use(forcedomain.ForceDomainRedirect())
    m.Get("/", func() string {
      return "Hello world!"
    })
    m.Run()
}

$ DOMAIN=http://example.com main

Meta

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceDomainRedirect

func ForceDomainRedirect() martini.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL