mirror of
https://github.com/wisplite/tether.git
synced 2026-05-01 06:22:41 -05:00
basic websocket handling and testing
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user