コード例 #1
1
ファイル: common.go プロジェクト: schaffers/typed
func Init(e *echo.Echo) {
	const (
		indexPath    string = "public/views/index.html"
		faviconPath  string = "public/favicon.ico"
		templatePath string = "public/views"
		staticPath   string = "public/static"
	)

	e.Index(indexPath)
	e.Favicon(faviconPath)
	e.Static("/static", staticPath)

	initTemplate(e, templatePath)
}
コード例 #2
0
ファイル: static.go プロジェクト: studygolang/studygolang
func serveStatic(e *echo.Echo) {
	for prefix, rootConf := range staticFileMap {
		filterPrefixs = append(filterPrefixs, prefix)

		if rootConf.isFile {
			e.File(prefix, ROOT+rootConf.root)
		} else {
			e.Static(prefix, ROOT+rootConf.root)
		}
	}
}
コード例 #3
0
ファイル: router.go プロジェクト: sheercat/evaltmpl
func Set(e *echo.Echo) *echo.Echo {

	e.Favicon("static/favicon.ico")
	e.Static("/", "static")

	e.Get("/", controller.Index)
	e.Get("/eval/", controller.Eval)
	e.Post("/eval/", controller.PostEval)

	return e
}
コード例 #4
0
ファイル: theme.go プロジェクト: mewben/onix
// Setup theme
func Setup(e *echo.Echo, mode string) {
	var t Template
	if mode == "dev" {
		// development
		t.templates = template.Must(template.ParseGlob("internals/themes/" + Theme + "/*.html"))

		e.Static("/assets", "internals/themes/"+Theme+"/assets")
		e.File("/favicon.ico", "internals/themes/"+Theme+"favicon.ico")
	} else {
		// production
		t.templates = template.Must(template.ParseGlob("public/themes/" + Theme + "/*.html"))

		e.Static("/assets", "public/themes/"+Theme+"/assets")
		e.File("/favicon.ico", "public/themes/"+Theme+"favicon.ico")
	}

	e.SetRenderer(&t)
}
コード例 #5
0
ファイル: main.go プロジェクト: flowup/flowup
// route will establish routes
func route(e *echo.Echo) {

	e.Static("/", "static")

	//api := e.Group("/api")
}