Skip to content

Commit

Permalink
Merge pull request #105 from yoyofx/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
yoyofx authored Nov 26, 2020
2 parents 4492c42 + e9153c7 commit 7b0a9a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion WebFramework/Router/DefaultRouterBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/yoyofx/yoyogo/WebFramework/Context"
"github.com/yoyofx/yoyogo/WebFramework/Mvc"
"net/url"
"path"
"strings"
)

Expand Down Expand Up @@ -45,7 +46,7 @@ func (router *DefaultRouterBuilder) SetConfiguration(config Abstractions.IConfig
mvcTemplate, hasTemplate := config.Get("yoyogo.application.server.mvc.template").(string)
if hasTemplate {
if hasPath {
mvcTemplate = serverPath + mvcTemplate
mvcTemplate = path.Join(serverPath, mvcTemplate)
}
router.mvcControllerBuilder.GetMvcOptions().MapRoute(mvcTemplate)
router.log.Info("mvc.template: %s", ConsoleColors.Green(mvcTemplate))
Expand Down
6 changes: 4 additions & 2 deletions WebFramework/WebApplicationBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ func (this *WebApplicationBuilder) buildMvc() {
err := this.hostContext.HostServices.GetServiceByName(&viewEngine, "viewEngine")
if err == nil {
option := this.routerBuilder.GetMvcBuilder().GetRouterHandler().Options.ViewOption
viewEngine.SetTemplatePath(option)
controllerBuilder.SetViewEngine(viewEngine)
if option != nil {
viewEngine.SetTemplatePath(option)
controllerBuilder.SetViewEngine(viewEngine)
}
}

// add controllers to application services
Expand Down

0 comments on commit 7b0a9a1

Please sign in to comment.