mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 02:11:40 +00:00
feature/driver indexed db (#12)
* fix: update commitizen version * feat: add WASM build tags to db actions * feat: Update all actions to follow `AddAsset` for error handling * feat: remove database dependency in dwn and motr commands * feat: add basic info form to registration view * feat: implement basic browser navigation component * refactor: move database related files to middleware * fix: remove unused test command * fix: update source directory for buf-publish workflow
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/internal/vfs/wasm"
|
||||
|
||||
"github.com/onsonr/sonr/internal/db"
|
||||
)
|
||||
|
||||
var dwn *DWN
|
||||
|
||||
type DWN struct {
|
||||
*echo.Echo
|
||||
DB *db.DB
|
||||
}
|
||||
|
||||
func main() {
|
||||
dwn = initRails()
|
||||
wasm.Serve(dwn.Echo)
|
||||
}
|
||||
|
||||
// initRails initializes the Rails application
|
||||
func initRails() *DWN {
|
||||
// Open the database
|
||||
e := echo.New()
|
||||
db, err := db.New()
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
db.ServeEcho(e.Group("/dwn"))
|
||||
|
||||
// Initialize the htmx handler
|
||||
return &DWN{
|
||||
Echo: e,
|
||||
DB: db,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user