list s3 bucket

This commit is contained in:
JurajKubrican
2024-11-18 16:18:36 +01:00
parent e9081c9bdc
commit c1ffce5c3a
9 changed files with 150 additions and 36 deletions

View File

@@ -3,9 +3,11 @@ package main
import (
"html/template"
"io"
"net/http"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/labstack/gommon/log"
)
type Templates struct {
@@ -29,9 +31,21 @@ func newPage() Page {
return Page{}
}
type Article struct {
Content string
}
func newArticle(content string) Article {
return Article{
Content: content,
}
}
func main() {
e := echo.New()
e.Renderer = NewTemplates()
e.Logger.SetLevel(log.DEBUG)
e.Use(middleware.Logger())
page := newPage()
@@ -43,5 +57,16 @@ func main() {
return c.Render(200, "index", page)
})
e.GET("/we-are-here", func(c echo.Context) error {
// Log a test message
e.Logger.Info("Test log: /we-are-here endpoint called")
msg := getNotes(c, e.Logger)
e.Logger.Info(msg)
article := newArticle(" content")
return c.Render(http.StatusOK, "article", article)
})
e.Logger.Fatal(e.Start(":54321"))
}