nrscstatic

package module
v0.0.0-...-77d7f4d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2013 License: MIT Imports: 7 Imported by: 0

README

nrscstatic

Martini middleware for serving static assets (Javascript, CSS, images, etc.) via nrsc. Should be interchangeable with Martini's built-in Static middleware.

Usage

package main

import (
    "github.com/Nitron/nrscstatic"
    "github.com/codegangsta/martini"
    "net/http"
)

func main() {
    m := martini.New()
    m.Use(martini.Recovery())
    m.Use(martini.Logger())
    m.Use(nrscstatic.NrscStatic("public"))
    http.ListenAndServe(":8080", m)
}
$ mkdir public
$ echo "test" > public/test.txt
$ go get
$ go install bitbucket.org/tebeka/nrsc/nrsc
$ go build nrsc_example.go
$ $GOPATH/bin/nrsc nrsc_example public
$ ./nrsc_example

Then visit http://localhost:8080/test.txt.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface{}

func NrscStatic

func NrscStatic(path string) Handler

NrscStatic returns a middleware handler (based on martini's Static middleware) that serves static files via nrsc (https://bitbucket.org/tebeka/nrsc)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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