add static route module

This commit is contained in:
yanghao05
2023-01-30 19:33:24 +08:00
parent 2553252049
commit 591543d2a8
6 changed files with 35 additions and 1 deletions

View File

@@ -32,7 +32,7 @@ Static = "./dist"
Https = false Https = false
HttpsCert = "" HttpsCert = ""
HttpKey = "" HttpKey = ""
Port = 8088 Port = 9800
[Http.Captcha] [Http.Captcha]
KeyLong = 6 KeyLong = 6

View File

@@ -1,5 +1,6 @@
package modules package modules
import ( import (
_ "atom/modules/resources/container"
_ "atom/modules/system/container" _ "atom/modules/system/container"
) )

0
modules/resources/.keep Normal file
View File

View File

@@ -0,0 +1,15 @@
package container
import (
"atom/container"
"atom/modules/resources/routes"
"log"
"go.uber.org/dig"
)
func init() {
if err := container.Container.Provide(routes.NewRoute, dig.Group("route")); err != nil {
log.Fatal(err)
}
}

View File

@@ -0,0 +1,18 @@
package routes
import (
"atom/contracts"
"atom/providers/http"
)
type Route struct {
svc *http.Service
}
func NewRoute(svc *http.Service) contracts.Route {
return &Route{svc: svc}
}
func (r *Route) Register() {
// r.svc.Engine.Static("/resources/form-generator", "./resources/form-generator")
}

0
resources/.gitkeep Normal file
View File