server: Add new set of message.

This commit is contained in:
Harshavardhana
2016-01-30 18:33:33 -08:00
parent 0784969767
commit a0c753b6eb
2 changed files with 46 additions and 83 deletions
+6 -3
View File
@@ -71,10 +71,13 @@ func getWebAPIHandler(web *WebAPI) http.Handler {
s.RegisterCodec(codec, "application/json; charset=UTF-8")
s.RegisterService(web, "Web")
mux := router.NewRouter()
// Add new RPC services here
mux.Handle("/rpc", s)
// Root router.
root := mux.NewRoute().PathPrefix("/").Subrouter()
root.Handle("/rpc", s)
// Enable this when we add assets.
// mux.Handle("/{file:.*}", http.FileServer(assetFS()))
// root.PathPrefix("/login").Handler(http.StripPrefix("/login", http.FileServer(assetFS())))
// root.Handle("/{file:.*}", http.FileServer(assetFS()))
return registerCustomMiddleware(mux, mwHandlers...)
}