-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
32 lines (27 loc) · 1.04 KB
/
main.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
package main
import (
"log"
"net/http"
)
func main() {
s := New()
http.HandleFunc("GET /{$}", s.indexHandler)
http.HandleFunc("GET /{username}", s.userHandler)
http.HandleFunc("GET /saves", s.userSavesHandler)
http.HandleFunc("GET /static/{file}", s.staticHandler)
http.HandleFunc("GET /discover", s.discoverHandler)
http.HandleFunc("GET /settings", s.settingsHandler)
http.HandleFunc("POST /settings/submit", s.settingsSubmitHandler)
http.HandleFunc("GET /login", s.loginHandler)
http.HandleFunc("POST /login", s.loginHandler)
http.HandleFunc("GET /logout", s.logoutHandler)
http.HandleFunc("POST /logout", s.logoutHandler)
http.HandleFunc("POST /register", s.registerHandler)
http.HandleFunc("GET /save/{url}", s.saveHandler)
http.HandleFunc("GET /feeds/{url}", s.feedDetailsHandler)
// left in-place for backwards compat
http.HandleFunc("GET /feeds", s.settingsHandler)
http.HandleFunc("POST /feeds/submit", s.settingsSubmitHandler)
log.Println("main: listening on http://localhost:5544")
log.Fatal(http.ListenAndServe(":5544", nil))
}