mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-30 16:47:16 +08:00
22 lines
405 B
Go
22 lines
405 B
Go
package handler
|
|
|
|
import (
|
|
"github.com/GoYoko/web"
|
|
"github.com/samber/do"
|
|
|
|
"github.com/chaitin/MonkeyCode/backend/config"
|
|
)
|
|
|
|
type StaticHandler struct {
|
|
}
|
|
|
|
func NewStaticHandler(i *do.Injector) (*StaticHandler, error) {
|
|
w := do.MustInvoke[*web.Web](i)
|
|
cfg := do.MustInvoke[*config.Config](i)
|
|
|
|
s := &StaticHandler{}
|
|
|
|
w.Echo().Static(cfg.StaticFiles.RoutePrefix, cfg.StaticFiles.Dir)
|
|
return s, nil
|
|
}
|