예제 #1
0
파일: app.go 프로젝트: umisama/kocha
package config

import (
	"path/filepath"
	"runtime"
	"time"

	"github.com/naoina/kocha"
)

var (
	AppName   = "testappname"
	Addr      = kocha.SettingEnv("KOCHA_ADDR", "127.0.0.1:9100")
	Env       = kocha.SettingEnv("KOCHA_ENV", "dev") // NOTE: deprecated. will be removed in future.
	AppConfig = &kocha.AppConfig{
		AppPath:       rootPath,
		AppName:       AppName,
		DefaultLayout: "app",
		TemplateSet: kocha.TemplateSet{
			{
				Name: AppName,
				Paths: []string{
					filepath.Join(rootPath, "app", "views"),
				},
			},
		},

		// Session settings
		Session: &kocha.SessionConfig{
			Name: "testappname_session",
			Store: &kocha.SessionCookieStore{
예제 #2
0
package config

import (
	"os"
	"path/filepath"
	"runtime"
	"time"

	"github.com/naoina/kocha"
	"github.com/naoina/kocha/log"
)

var (
	AppName   = "myapp"
	AppConfig = &kocha.Config{
		Addr:          kocha.SettingEnv("KOCHA_ADDR", "127.0.0.1:9100"),
		AppPath:       rootPath,
		AppName:       AppName,
		DefaultLayout: "app",
		Template: &kocha.Template{
			PathInfo: kocha.TemplatePathInfo{
				Name: AppName,
				Paths: []string{
					filepath.Join(rootPath, "app", "view"),
				},
			},
			FuncMap: kocha.TemplateFuncMap{},
		},

		// Logger settings.
		Logger: &kocha.LoggerConfig{