-
-
Save syrm/ab91e433f37844d35dab809f153ca0eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Home struct { | |
Database *gorm.DB | |
Sessions *sessions.Sessions | |
ImagePath string | |
} | |
func (c *Home) AfterActivation(a mvc.AfterActivation) { | |
a.GetRoute("Get").Name = "home" | |
a.GetRoute("GetBy").Name = "home/voiture" | |
} | |
func (c *Home) GetBy(name string) mvc.Result { | |
println("Youuuuuuuuuuuuuu " + name) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvc.Configure(app.Party("/"), func(app *mvc.Application) { | |
app.Register(logger, database, sessions) | |
base(app, logger, database, sessions) | |
}) | |
func base(app *mvc.Application, logger *zerolog.Logger, database *gorm.DB, sessions *sessions.Sessions) { | |
app.Handle(&controllers.Home{ | |
Database: database, | |
Sessions: sessions, | |
ImagePath: os.Getenv("WEB_IMAGE_PATH"), | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i go on http://localhost:8080/toto | |
i get : Youuuuuuuuuuuuuu ../data/web/images/ | |
instead : Youuuuuuuuuuuuuu toto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment