modweb/examples/test/hello-world/main.go

31 lines
539 B
Go
Raw Normal View History

2020-11-11 22:48:11 +00:00
package hello_world
2020-11-11 23:51:23 +00:00
import (
"git.ddd.rip/ptrcnull/modweb"
"github.com/gofiber/fiber/v2"
"github.com/markbates/pkger"
)
2020-11-11 22:48:11 +00:00
type HelloWorldModule struct {}
2020-11-11 23:51:23 +00:00
func (m *HelloWorldModule) Init(mm *modweb.ModuleManager) {
//mm.RegisterViews(pkger.Dir("/templates"))
app := mm.Fiber()
app.Get("/", func(ctx *fiber.Ctx) error {
return mm.Render(ctx, "")
})
2020-11-11 22:48:11 +00:00
}
func (m *HelloWorldModule) Name() string {
return "hello-world"
}
func (m *HelloWorldModule) FriendlyName() string {
return "Hello World"
}
var Module = HelloWorldModule{}