-
Notifications
You must be signed in to change notification settings - Fork 4
/
frontend.go
25 lines (22 loc) · 901 Bytes
/
frontend.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
//package frontend is the web frontend for goci
package frontend
import (
"code.google.com/p/gorilla/pat"
"github.com/zeebo/goci/app/httputil"
"net/http"
)
//Mux is the handler for the frontend
var Mux = pat.New()
//register all the handlers with the serve mux
func init() {
Mux.Add("GET", "/static/", http.StripPrefix("/static", http.FileServer(Config)))
Mux.Add("GET", "/work/{key:.+}", httputil.Handler(specificWork))
Mux.Add("GET", "/work", httputil.Handler(work))
Mux.Add("GET", "/result/{import:[^@]+}@{rev:.*}", httputil.Handler(specificImportResult))
Mux.Add("GET", "/result/{import:[^@]+}", httputil.Handler(importResult))
Mux.Add("GET", "/result", httputil.Handler(result))
Mux.Add("GET", "/image/{import:.+}", httputil.Handler(image))
Mux.Add("GET", "/how", httputil.Handler(how))
Mux.Add("GET", "/pkg", httputil.Handler(pkg))
Mux.Add("GET", "/", httputil.Handler(index))
}