add static route module
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
0
modules/resources/.keep
Normal file
15
modules/resources/container/container.go
Normal file
15
modules/resources/container/container.go
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
18
modules/resources/routes/routes.go
Normal file
18
modules/resources/routes/routes.go
Normal 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
0
resources/.gitkeep
Normal file
Reference in New Issue
Block a user