mirror of
https://github.com/ghostersk/gowebmail.git
synced 2026-04-17 08:36:01 +01:00
30 lines
750 B
Go
30 lines
750 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/ghostersk/gowebmail/config"
|
|
"github.com/ghostersk/gowebmail/internal/db"
|
|
)
|
|
|
|
// AppHandler serves the main app pages using the shared Renderer.
|
|
type AppHandler struct {
|
|
db *db.DB
|
|
cfg *config.Config
|
|
renderer *Renderer
|
|
}
|
|
|
|
func (h *AppHandler) Index(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "app", nil)
|
|
}
|
|
|
|
// ViewMessage renders a single message in a full browser tab.
|
|
func (h *AppHandler) ViewMessage(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "message", nil)
|
|
}
|
|
|
|
// ComposePage renders the compose form in a full browser tab.
|
|
func (h *AppHandler) ComposePage(w http.ResponseWriter, r *http.Request) {
|
|
h.renderer.Render(w, "compose", nil)
|
|
}
|