renamed package
This commit is contained in:
parent
4697006d10
commit
5e8b9a0bf6
@ -4,7 +4,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/codegangsta/negroni"
|
||||
jch_http "github.com/jchenry/jchenry/http"
|
||||
_http "github.com/jchenry/jchenry/http"
|
||||
"gopkg.in/auth0.v1/management"
|
||||
)
|
||||
|
||||
@ -16,7 +16,7 @@ type ServiceInstance struct {
|
||||
c Config
|
||||
}
|
||||
|
||||
func (si ServiceInstance) Register(uriBase string, s *jch_http.Server) {
|
||||
func (si ServiceInstance) Register(uriBase string, s *_http.Server) {
|
||||
|
||||
s.Get(uriBase+"/login", "login endpoint", http.HandlerFunc(NewLoginHandler(si.c)))
|
||||
s.Get(uriBase+"/logout", "logout endpoint", http.HandlerFunc(LogoutHandler))
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/codegangsta/negroni"
|
||||
"github.com/jchenry/jchenry/auth"
|
||||
jch_http "github.com/jchenry/jchenry/http"
|
||||
_http "github.com/jchenry/jchenry/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -16,7 +16,7 @@ func main() {
|
||||
|
||||
func StartServer() {
|
||||
auth.PrintConfig()
|
||||
s := jch_http.NewServer(negroni.New(), jch_http.NewJulienschmidtHTTPRouter()).
|
||||
s := _http.NewServer(negroni.New(), _http.NewJulienschmidtHTTPRouter()).
|
||||
Static("/public/*filepath", http.Dir("public/")).
|
||||
Service("", auth.Service(auth.FromEnv())).
|
||||
Get("/", "", http.HandlerFunc(HomeHandler))
|
||||
@ -30,5 +30,5 @@ func StartServer() {
|
||||
}
|
||||
|
||||
func HomeHandler(w http.ResponseWriter, r *http.Request) {
|
||||
jch_http.RenderTemplate(w, "home", nil)
|
||||
_http.RenderTemplate(w, "home", nil)
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/codegangsta/negroni"
|
||||
"github.com/jchenry/jchenry/auth"
|
||||
jch_http "github.com/jchenry/jchenry/http"
|
||||
_http "github.com/jchenry/jchenry/http"
|
||||
"github.com/jchenry/jchenry/payments"
|
||||
)
|
||||
|
||||
@ -20,7 +20,7 @@ func StartServer() {
|
||||
payments.PrintConfig()
|
||||
|
||||
auth_service := auth.Service(auth.FromEnv())
|
||||
s := jch_http.NewServer(negroni.New(), jch_http.NewJulienschmidtHTTPRouter()).
|
||||
s := _http.NewServer(negroni.New(), _http.NewJulienschmidtHTTPRouter()).
|
||||
Static("/public/*filepath", http.Dir("public/")).
|
||||
Service("", auth_service).
|
||||
Service("", payments.Service(payments.FromEnv(), &auth_service)).
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/codegangsta/negroni"
|
||||
"github.com/jchenry/jchenry/auth"
|
||||
jch_http "github.com/jchenry/jchenry/http"
|
||||
_http "github.com/jchenry/jchenry/http"
|
||||
"github.com/stripe/stripe-go"
|
||||
"github.com/stripe/stripe-go/client"
|
||||
"github.com/stripe/stripe-go/customer"
|
||||
@ -32,7 +32,7 @@ type ServiceInstance struct {
|
||||
auth *auth.ServiceInstance
|
||||
}
|
||||
|
||||
func (si ServiceInstance) Register(uriBase string, s *jch_http.Server) {
|
||||
func (si ServiceInstance) Register(uriBase string, s *_http.Server) {
|
||||
s.Get(uriBase+"/subscription", "subscription info endpoint", negroni.New(
|
||||
negroni.HandlerFunc(auth.IsAuthenticated),
|
||||
negroni.Wrap(http.HandlerFunc(si.subscriptionHandler)),
|
||||
@ -56,7 +56,7 @@ func (si ServiceInstance) subscriptionHandler(w http.ResponseWriter, r *http.Req
|
||||
for it.Next() {
|
||||
plans = append(plans, *it.Plan())
|
||||
}
|
||||
jch_http.RenderTemplate(w, "subscription", offering{Product: *prod, Plans: plans})
|
||||
_http.RenderTemplate(w, "subscription", offering{Product: *prod, Plans: plans})
|
||||
}
|
||||
|
||||
type offering struct {
|
||||
|
Loading…
Reference in New Issue
Block a user