Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 543 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 543 Bytes

statio

serves static files and http file system

package main

import (
	"github.com/macross-contrib/statio"
	"macross"
)

func main() {
	m := macross.New()

	// if Allow DirectoryIndex
	//m.Use(statio.Serve("/", statio.LocalFile("/tmp", true)))
	// set prefix
	//m.Use(statio.Serve("/static", statio.LocalFile("/tmp", true)))

	m.Use(statio.Serve("/", statio.LocalFile("/tmp", false)))
	m.Get("/ping", func(self *macross.Context) error {
		return self.String("pong")
	})
	// Listen and Server in 0.0.0.0:8080
	m.Listen(":8080")
}