Esempio n. 1
0
func TestCreateApp(t *testing.T) {
	config := libs.NewConfig()
	config.Template.Path = "../"
	require.NotNil(t, config)

	app := libs.NewApp(config)
	assert.NotNil(t, app)
}
Esempio n. 2
0
func main() {
	var configPath string

	flag.StringVar(&configPath, "c", "config.json", "Path to config file")
	flag.Parse()
	flag.Visit(func(v *flag.Flag) {
		fmt.Printf("%s - %s: %s\n", v.Usage, v.Name, v.Value)
	})

	config := libs.NewConfigFile(configPath)

	app := libs.NewApp(config)
	app.UseStaticRouter("./static/")
	app.UseRouter("/", &routes.Index{})
	app.UseRouter("/api", &routes.Api{})
	app.Run()
}