func NewApp(instance wcg.Server) *server.App { app := server.NewApp("_debug") app.GET("/routes.txt", wcg.AnonymousHandler(func(res *wcg.Response, req *wcg.Request) { res.Header().Set("Content-Type", "text/plain") res.WriteString(fmt.Sprintf("%v", instance.Routes())) res.End() })) app.GET("/env.txt", middleware.Gate("debugger"), wcg.AnonymousHandler(func(res *wcg.Response, req *wcg.Request) { res.Header().Set("Content-Type", "text/plain") res.WriteString("[Environment Variable]\n") for _, v := range os.Environ() { res.WriteString(fmt.Sprintf(" %v\n", v)) } res.WriteString("\n") res.WriteString("[Http Header]\n") for k, vlist := range req.HTTPRequest().Header { for _, v := range vlist { res.WriteString(fmt.Sprintf(" %s=%s\n", k, v)) } } })) app.GET("/config.json", middleware.Gate("debugger"), wcg.AnonymousHandler(func(res *wcg.Response, req *wcg.Request) { res.WriteJSON(map[string]interface{}{ "wcg.DefaultLogConfig": wcg.DefaultLogConfig, }) })) return app }
// NewApp returns *server.App instance for 'hplink' func NewApp() *server.App { app := server.NewApp("hplink") setupAPITasks(app) setupAPICrawlerSettings(app) setupAPIMembers(app) setupAPIArtist(app) return app }
func NewApp() *server.App { app := server.NewApp("admin") app.Title = "システム管理" setupAPIGates(app) setupAPIConfigs(app) setupAPIOAuth2(app) setupAPIAPITokens(app) setupAPIDatastore(app) setupAPIStats(app) setupAPITasks(app) setupPage(app) return app }
func Test_Page_Title(t *testing.T) { assert := gaetest.NewAssert(t) app := server.NewApp("testapp") app.Title = "This is Test App" page := app.Page() page.GET("/a.html", Title("FOO")) req := ts.GET("/testapp/a.html") res := req.RouteTo(app.Routes()) assert.HTTPStatus(200, res) _assert := assert.HTMLResponse(res) _assert.Text("FOO - This is Test App", "title") }
// NewApp creates an app instance func NewApp() *server.App { app := server.NewApp("intern/pt") app.Title = "録画管理" setupAPIChannels(app) setupAPIIEPGRecords(app) setupAPIIEPGKeywords(app) setupAPIIEPGExclusions(app) setupAPIFBMessegner(app) setupAPIConfigs(app) setupPage(app) setupCronIEPGDailyNotification(app) app.Init = func(req *wcg.Request) { req.Logger.Infof("[intern.pt] Install Default Channels...") Channel.PutMulti().Cache(_CacheAllChannels).MustUpdate(req, defaultChannels) } return app }
func NewApp() *server.App { app := server.NewApp("hooks") app.Title = "Webhooks" setupAPIFBMessenger(app) return app }
func NewApp() *server.App { app := server.NewApp("users") app.Title = "ユーザー" setupAPIUsers(app) return app }
func NewApp() *server.App { app := server.NewApp(":artist") app.Title = "H!P Link" return app }
func NewApp() *server.App { app := server.NewApp("hplink") app.Title = "H!P Link Admin" setupPage(app) return app }