~repos /gromer

#golang#htmx#ssr

git clone https://pyrossh.dev/repos/gromer.git

gromer is a framework and cli to build multipage web apps in golang using htmx and alpinejs.


72f76fc1 Peter John

3 years ago
move to main again
_example/components/init.go DELETED
@@ -1,8 +0,0 @@
1
- package components
2
-
3
- import "github.com/pyros2097/gromer/gsx"
4
-
5
- func init() {
6
- gsx.RegisterComponent(Todo, TodoStyles, "todo")
7
- gsx.RegisterComponent(Status, StatusStyles, "status", "error")
8
- }
_example/containers/init.go DELETED
@@ -1,8 +0,0 @@
1
- package containers
2
-
3
- import "github.com/pyros2097/gromer/gsx"
4
-
5
- func init() {
6
- gsx.RegisterComponent(TodoCount, nil, "filter")
7
- gsx.RegisterComponent(TodoList, nil, "page", "filter")
8
- }
_example/main.go CHANGED
@@ -2,10 +2,20 @@ package main
2
2
 
3
3
  import (
4
4
  "github.com/pyros2097/gromer"
5
- _ "github.com/pyros2097/gromer/_example/components"
5
+ "github.com/pyros2097/gromer/_example/components"
6
+ "github.com/pyros2097/gromer/_example/containers"
6
- _ "github.com/pyros2097/gromer/_example/routes"
7
+ "github.com/pyros2097/gromer/_example/routes"
8
+ "github.com/pyros2097/gromer/assets"
9
+ "github.com/pyros2097/gromer/gsx"
7
10
  )
8
11
 
9
12
  func main() {
13
+ gsx.RegisterComponent(components.Todo, components.TodoStyles, "todo")
14
+ gsx.RegisterComponent(components.Status, components.StatusStyles, "status", "error")
15
+ gsx.RegisterComponent(containers.TodoCount, nil, "filter")
16
+ gsx.RegisterComponent(containers.TodoList, nil, "page", "filter")
17
+ gromer.Init(components.Status, assets.FS)
18
+ gromer.PageRoute("/", routes.TodosPage, routes.TodosAction)
19
+ gromer.PageRoute("/about", routes.AboutPage, nil)
10
20
  gromer.Run("3000")
11
21
  }
_example/routes/init.go DELETED
@@ -1,13 +0,0 @@
1
- package routes
2
-
3
- import (
4
- "github.com/pyros2097/gromer"
5
- "github.com/pyros2097/gromer/_example/components"
6
- "github.com/pyros2097/gromer/assets"
7
- )
8
-
9
- func init() {
10
- gromer.Init(components.Status, assets.FS)
11
- gromer.PageRoute("/", TodosPage, TodosAction)
12
- gromer.PageRoute("/about", AboutPage, nil)
13
- }