Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
natewong1313 committed Jan 16, 2024
1 parent 7478710 commit 6b946bf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 32 deletions.
18 changes: 9 additions & 9 deletions examples/echo/main.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package main

import (
"log"
"math/rand"
"net/http"

"example.com/echo/models"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
gossr "github.com/natewong1313/go-react-ssr"
"log"
"math/rand"
"net/http"
)

var APP_ENV string
Expand All @@ -18,12 +19,11 @@ func main() {
e.Static("/assets", "../frontend-mui/public/")

engine, err := gossr.New(gossr.Config{
AppEnv: APP_ENV,
AssetRoute: "/assets",
FrontendDir: "../frontend-mui/src",
GeneratedTypesPath: "../frontend-mui/src/generated.d.ts",
PropsStructsPath: "./models/props.go",
LayoutFilePath: "Layout.tsx",
AppEnv: APP_ENV,
AssetRoute: "/assets",
FrontendSrcDir: "../frontend/src",
PropsStructsPath: "./models/props.go",
LayoutFile: "Layout.tsx",
})
if err != nil {
log.Fatal("Failed to init go-react-ssr")
Expand Down
9 changes: 4 additions & 5 deletions examples/fiber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ func main() {
app.Static("/assets", "../frontend/public/")

engine, err := gossr.New(gossr.Config{
AppEnv: APP_ENV,
AssetRoute: "/assets",
FrontendDir: "../frontend/src",
GeneratedTypesPath: "../frontend/src/generated.d.ts",
PropsStructsPath: "./models/props.go",
AppEnv: APP_ENV,
AssetRoute: "/assets",
FrontendSrcDir: "../frontend/src",
PropsStructsPath: "./models/props.go",
})
if err != nil {
log.Fatal("Failed to init go-react-ssr")
Expand Down
4 changes: 0 additions & 4 deletions examples/frontend-tailwind/src/Layout.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions examples/frontend-tailwind/src/Main.css

This file was deleted.

14 changes: 3 additions & 11 deletions examples/gin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,13 @@ func main() {
g := gin.Default()
g.StaticFile("favicon.ico", "../frontend-tailwind/public/favicon.ico")
g.Static("/assets", "../frontend-tailwind/public")
// config := gossr.NewDefaultConfig().
// WithTailwind().
// WithLayout("Layout.tsx")
engine, err := gossr.New(gossr.Config{
AppEnv: APP_ENV,
AssetRoute: "/assets",
// FrontendDir: "../frontend-tailwind/src",
// GeneratedTypesPath: "../frontend-tailwind/src/generated.d.ts",
// TailwindConfigPath: "../frontend-tailwind/tailwind.config.js",
// LayoutCSSFilePath: "Main.css",
AppEnv: APP_ENV,
AssetRoute: "/assets",
FrontendSrcDir: "../frontend-tailwind/src",
LayoutFile: "Layout.tsx",
PropsStructsPath: "./models/props.go",
TailwindEnabled: true,
})
engine, err := gossr.New(config)
if err != nil {
log.Fatal("Failed to init go-react-ssr")
}
Expand Down

0 comments on commit 6b946bf

Please sign in to comment.