This repository was archived by the owner on Apr 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappengine.go
43 lines (35 loc) · 1.5 KB
/
appengine.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// +build appengine
package main
import (
"net/http"
"github.com/koffeinsource/notreddit/targets/check"
"github.com/koffeinsource/notreddit/targets/email"
"github.com/koffeinsource/notreddit/targets/share"
"github.com/koffeinsource/notreddit/targets/show"
"github.com/koffeinsource/notreddit/targets/startpage"
"github.com/gorilla/mux"
)
var router = mux.NewRouter()
//<domain>/k/check/json/<namespace> <- check namespace status
//<domain>/k/show/www/<namespace> <- html ansicht
//<domain>/k/show/rss/<namespace> <- rss feed
//<domain>/k/twitter/connect/<namespace>
//<domain>/k/twitter/disconnect/<namespace>
//<domain>/k/email/connect/<namespace>
//<domain>/k/share/<namespace> <- extension url
func init() {
router.HandleFunc("/", startpage.Dispatch)
router.HandleFunc("/k/check/json/{namespace}/", check.DispatchJSON)
router.HandleFunc("/k/check/json/{namespace}", check.DispatchJSON)
router.HandleFunc("/k/share/json/{namespace}/", share.DispatchJSON)
router.HandleFunc("/k/share/json/{namespace}", share.DispatchJSON)
router.HandleFunc("/k/show/json/{namespace}/", show.DispatchJSON)
router.HandleFunc("/k/show/json/{namespace}", show.DispatchJSON)
router.HandleFunc("/k/show/www/{namespace}/", show.DispatchWWW)
router.HandleFunc("/k/show/www/{namespace}", show.DispatchWWW)
router.HandleFunc("/k/show/rss/{namespace}/", show.DispatchRSS)
router.HandleFunc("/k/show/rss/{namespace}", show.DispatchRSS)
// TODO move to router
http.HandleFunc("/_ah/mail/", email.DispatchEmail)
http.Handle("/", router)
}