Compare commits
2 Commits
ab7cac7995
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| fbcf87118d | |||
| 8b1c9d02c5 |
@ -1,6 +1,6 @@
|
||||
package data
|
||||
|
||||
import "templ-tests/app/types"
|
||||
import "htmx-templ/app/types"
|
||||
|
||||
var CatBreeds []types.CatBreed = []types.CatBreed{
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"templ-tests/app/templates"
|
||||
"htmx-templ/app/templates"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"templ-tests/app/templates"
|
||||
"templ-tests/app/types"
|
||||
"htmx-templ/app/templates"
|
||||
"htmx-templ/app/types"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"htmx-templ/app/data"
|
||||
"htmx-templ/app/templates"
|
||||
"htmx-templ/app/types"
|
||||
"strconv"
|
||||
"strings"
|
||||
"templ-tests/app/data"
|
||||
"templ-tests/app/templates"
|
||||
"templ-tests/app/types"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
@ -6,6 +6,7 @@ import (
|
||||
"github.com/gofiber/fiber/v2/middleware/adaptor"
|
||||
)
|
||||
|
||||
// example taken from https://github.com/a-h/templ/tree/main/examples/integration-gofiber
|
||||
func Render(c *fiber.Ctx, component templ.Component, options ...func(*templ.ComponentHandler)) error {
|
||||
componentHandler := templ.Handler(component)
|
||||
for _, o := range options {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
import "templ-tests/app/router"
|
||||
import "htmx-templ/app/router"
|
||||
|
||||
func main() {
|
||||
router.Serve()
|
||||
|
||||
@ -2,8 +2,8 @@ package router
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"htmx-templ/app/handlers"
|
||||
"strings"
|
||||
"templ-tests/app/handlers"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
@ -17,7 +17,10 @@ const (
|
||||
)
|
||||
|
||||
func initApp() *fiber.App {
|
||||
app := fiber.New()
|
||||
app := fiber.New(fiber.Config{
|
||||
CaseSensitive: true,
|
||||
StrictRouting: true,
|
||||
})
|
||||
return app
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package templates
|
||||
|
||||
import (
|
||||
"templ-tests/app/types"
|
||||
"templ-tests/app/data"
|
||||
"htmx-templ/app/types"
|
||||
"htmx-templ/app/data"
|
||||
"slices"
|
||||
"sort"
|
||||
)
|
||||
|
||||
@ -11,10 +11,10 @@ import "io"
|
||||
import "bytes"
|
||||
|
||||
import (
|
||||
"htmx-templ/app/data"
|
||||
"htmx-templ/app/types"
|
||||
"slices"
|
||||
"sort"
|
||||
"templ-tests/app/data"
|
||||
"templ-tests/app/types"
|
||||
)
|
||||
|
||||
func interactiveButtonsSection() templ.Component {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package templates
|
||||
|
||||
import "templ-tests/app/types"
|
||||
import "htmx-templ/app/types"
|
||||
|
||||
type PageContext struct {
|
||||
Title string
|
||||
|
||||
Reference in New Issue
Block a user