basic websocket handling and testing

This commit is contained in:
wisplite
2026-04-07 12:01:42 -05:00
parent 5449dc7fe9
commit 27dc7818f7
4 changed files with 77 additions and 0 deletions
+10
View File
@@ -2,6 +2,7 @@ package tether
import (
"log/slog"
"net/http"
"github.com/wisplite/tether/reactivity"
"gorm.io/gorm"
@@ -28,3 +29,12 @@ func (e *Engine) RegisterQuery(name string, query func(ctx *QueryCtx) error) {
e.queries[name] = query
slog.Debug("Registered query", "name", name)
}
func (e *Engine) CreateTable(name string, schema interface{}) {
e.db.AutoMigrate(schema)
slog.Debug("Created table", "name", name)
}
func (e *Engine) Handle(w http.ResponseWriter, r *http.Request) {
reactivity.Handle(w, r)
}