Skip to content

HuguesGuilleus/static.v3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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))
}

About

Simple HTTP load assets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages