Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 727 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 727 Bytes

static.v3

PkgGoDev

Create easily a http Handler for static file.

Installation

go get github.com/HuguesGuilleus/static.v3

Example

package main

import (
	"github.com/HuguesGuilleus/static.v3"
	"log"
	"net/http"
)

func main() {
	// To pass in Dev mode.
	// static.Dev = true

	http.HandleFunc("/", static.Html().File("front/index.html"))
	http.HandleFunc("/style.css", static.Css().File("front/style.css"))
	http.HandleFunc("/app.js", static.Js().File("front/app.js"))
	http.HandleFunc("/favicon.png", static.Png().File("front/favicon.png"))

	log.Fatal(http.ListenAndServe(":8000", nil))
}