Beispiel #1
0
	pattern string
	handler http.HandlerFunc
}

var routes = []route{
	{"/", controllers.MainHandler},
	{"/openidcallback", login.SteamLoginCallbackHandler},
	{"/startLogin", login.SteamLoginHandler},
	{"/logout", login.SteamLogoutHandler},
	{"/websocket/", controllers.SocketHandler},
	{"/startMockLogin", login.SteamMockLoginHandler},
	{"/startTwitchLogin", login.TwitchLoginHandler},
	{"/twitchAuth", login.TwitchAuthHandler},
	{"/twitchLogout", login.TwitchLogoutHandler},

	{"/admin", chelpers.FilterHTTPRequest(helpers.ActionViewPage, admin.ServeAdminPage)},
	{"/admin/roles", chelpers.FilterHTTPRequest(helpers.ActionViewPage, admin.ChangeRole)},
	{"/admin/ban", chelpers.FilterHTTPRequest(helpers.ActionViewPage, admin.BanPlayer)},
	{"/admin/chatlogs", chelpers.FilterHTTPRequest(helpers.ActionViewLogs, admin.GetChatLogs)},
	{"/admin/banlogs", chelpers.FilterHTTPRequest(helpers.ActionViewLogs, admin.GetBanLogs)},
	{"/admin/server/", chelpers.FilterHTTPRequest(helpers.ModifyServers, admin.ViewServerPage)},
	{"/admin/server/add", chelpers.FilterHTTPRequest(helpers.ModifyServers, admin.AddServer)},
	{"/admin/server/remove", chelpers.FilterHTTPRequest(helpers.ModifyServers, admin.RemoveServer)},
	{"/admin/lobbies", chelpers.FilterHTTPRequest(helpers.ActionViewLogs, admin.ViewOpenLobbies)},

	{"/stats", stats.StatsHandler},
	{"/badge/", controllers.TwitchBadge},
	{"/resetMumblePassword", controllers.ResetMumblePassword},
}

func SetupHTTP(mux *http.ServeMux) {
Beispiel #2
0
	"github.com/TF2Stadium/Helen/helpers"
)

type route struct {
	pattern string
	handler func(http.ResponseWriter, *http.Request)
}

var routes = []route{
	{"/", controllers.MainHandler},
	{"/openidcallback", login.LoginCallbackHandler},
	{"/startLogin", login.LoginHandler},
	{"/logout", login.LogoutHandler},
	{"/websocket/", controllers.SocketHandler},

	{"/admin", chelpers.FilterHTTPRequest(helpers.ActionViewPage, admin.ServeAdminPage)},

	{"/admin/roles", chelpers.FilterHTTPRequest(helpers.ActionViewPage, admin.ServeAdminRolePage)},
	{"/admin/roles/addadmin", chelpers.FilterHTTPRequest(helpers.ActionChangeRole, admin.AddAdmin)},
	{"/admin/roles/addmod", chelpers.FilterHTTPRequest(helpers.ActionChangeRole, admin.AddMod)},
	{"/admin/roles/remove", chelpers.FilterHTTPRequest(helpers.ActionChangeRole, admin.Remove)},
	{"/admin/roles/adddev", chelpers.FilterHTTPRequest(helpers.ActionChangeRole, admin.AddDeveloper)},

	{"/admin/ban", chelpers.FilterHTTPRequest(helpers.ActionViewPage, admin.ServeAdminBanPage)},
	{"/admin/ban/join", chelpers.FilterHTTPRequest(helpers.ActionBanJoin, admin.BanJoin)},
	{"/admin/ban/create", chelpers.FilterHTTPRequest(helpers.ActionBanCreate, admin.BanCreate)},
	{"/admin/ban/chat", chelpers.FilterHTTPRequest(helpers.ActionBanChat, admin.BanChat)},

	{"/admin/chatlogs", chelpers.FilterHTTPRequest(helpers.ActionViewLogs, admin.GetChatLogs)},
	{"/admin/banlogs", chelpers.FilterHTTPRequest(helpers.ActionViewLogs, admin.DisplayLogs)},
}