mirror of
https://github.com/cf-sonr/motr.git
synced 2026-01-12 02:59:13 +00:00
feat: introduce API client for market data
This commit is contained in:
@@ -9,10 +9,10 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/sonr-io/motr/config"
|
||||
"github.com/sonr-io/motr/middleware/database"
|
||||
"github.com/sonr-io/motr/middleware/kvstore"
|
||||
"github.com/sonr-io/motr/middleware/session"
|
||||
"github.com/sonr-io/motr/middleware/sonrapi"
|
||||
"github.com/sonr-io/motr/middleware/webauthn"
|
||||
"github.com/syumai/workers"
|
||||
"github.com/syumai/workers/cloudflare/cron"
|
||||
@@ -31,11 +31,10 @@ func loadHandler() http.Handler {
|
||||
session.Middleware(),
|
||||
database.Middleware(),
|
||||
kvstore.Middleware(),
|
||||
sonrapi.Middleware(),
|
||||
webauthn.Middleware(),
|
||||
)
|
||||
setupViews(e)
|
||||
setupPartials(e)
|
||||
config.RegisterViews(e)
|
||||
config.RegisterPartials(e)
|
||||
return e
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/sonr-io/motr/handlers"
|
||||
"github.com/sonr-io/motr/internal/ui/home"
|
||||
"github.com/sonr-io/motr/internal/ui/login"
|
||||
"github.com/sonr-io/motr/internal/ui/register"
|
||||
"github.com/sonr-io/motr/middleware/render"
|
||||
)
|
||||
|
||||
// ╭────────────────────────────────────────────────╮
|
||||
// │ HTTP Routes │
|
||||
// ╰────────────────────────────────────────────────╯
|
||||
|
||||
func setupViews(e *echo.Echo) {
|
||||
e.GET("/", render.Page(home.HomeView()))
|
||||
e.GET("/login", render.Page(login.LoginView()))
|
||||
e.GET("/register", render.Page(register.RegisterView()))
|
||||
}
|
||||
|
||||
func setupPartials(e *echo.Echo) {
|
||||
e.POST("/login/:handle/check", handlers.HandleLoginCheck)
|
||||
e.POST("/login/:handle/finish", handlers.HandleLoginFinish)
|
||||
e.POST("/register/:handle", handlers.HandleRegisterStart)
|
||||
e.POST("/register/:handle/check", handlers.HandleRegisterCheck)
|
||||
e.POST("/register/:handle/finish", handlers.HandleRegisterFinish)
|
||||
e.POST("/status", handlers.HandleStatusCheck)
|
||||
}
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/sonr-io/motr/config"
|
||||
"github.com/sonr-io/motr/middleware/database"
|
||||
"github.com/sonr-io/motr/middleware/kvstore"
|
||||
"github.com/sonr-io/motr/middleware/session"
|
||||
"github.com/sonr-io/motr/middleware/sonrapi"
|
||||
"github.com/sonr-io/motr/middleware/webauthn"
|
||||
"github.com/syumai/workers"
|
||||
"github.com/syumai/workers/cloudflare/cron"
|
||||
@@ -31,11 +31,10 @@ func loadHandler() http.Handler {
|
||||
session.Middleware(),
|
||||
database.Middleware(),
|
||||
kvstore.Middleware(),
|
||||
sonrapi.Middleware(),
|
||||
webauthn.Middleware(),
|
||||
)
|
||||
setupViews(e)
|
||||
setupPartials(e)
|
||||
config.RegisterViews(e)
|
||||
config.RegisterPartials(e)
|
||||
return e
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/sonr-io/motr/handlers"
|
||||
"github.com/sonr-io/motr/internal/ui/home"
|
||||
"github.com/sonr-io/motr/internal/ui/login"
|
||||
"github.com/sonr-io/motr/internal/ui/register"
|
||||
"github.com/sonr-io/motr/middleware/render"
|
||||
)
|
||||
|
||||
// ╭────────────────────────────────────────────────╮
|
||||
// │ HTTP Routes │
|
||||
// ╰────────────────────────────────────────────────╯
|
||||
|
||||
func setupViews(e *echo.Echo) {
|
||||
e.GET("/", render.Page(home.HomeView()))
|
||||
e.GET("/login", render.Page(login.LoginView()))
|
||||
e.GET("/register", render.Page(register.RegisterView()))
|
||||
}
|
||||
|
||||
func setupPartials(e *echo.Echo) {
|
||||
e.POST("/login/:handle/check", handlers.HandleLoginCheck)
|
||||
e.POST("/login/:handle/finish", handlers.HandleLoginFinish)
|
||||
e.POST("/register/:handle", handlers.HandleRegisterStart)
|
||||
e.POST("/register/:handle/check", handlers.HandleRegisterCheck)
|
||||
e.POST("/register/:handle/finish", handlers.HandleRegisterFinish)
|
||||
e.POST("/status", handlers.HandleStatusCheck)
|
||||
}
|
||||
Reference in New Issue
Block a user