Skip to content

macross-contrib/statio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published