mirror of https://github.com/gofiber/fiber.git
Update readme example
parent
df65a5785b
commit
9e2f3d4a07
|
@ -218,15 +218,15 @@ Already supports:
|
|||
func main() {
|
||||
// You can setup template engine before initiation app:
|
||||
app := fiber.New(&fiber.Settings{
|
||||
ViewEngine: "mustache",
|
||||
ViewFolder: "./views",
|
||||
ViewExtension: ".tmpl",
|
||||
TemplateEngine: "mustache",
|
||||
TemplateFolder: "./views",
|
||||
TemplateExtension: ".tmpl",
|
||||
})
|
||||
|
||||
// OR after initiation app at any convenient location:
|
||||
app.Settings.ViewEngine = "mustache"
|
||||
app.Settings.ViewFolder = "./views"
|
||||
app.Settings.ViewExtension = ".tmpl"
|
||||
app.Settings.TemplateEngine = "mustache"
|
||||
app.Settings.TemplateFolder = "./views"
|
||||
app.Settings.TemplateExtension = ".tmpl"
|
||||
|
||||
// And now, you can call template `./views/home.tmpl` like this:
|
||||
app.Get("/", func(c *fiber.Ctx) {
|
||||
|
|
|
@ -212,15 +212,15 @@ func main() {
|
|||
func main() {
|
||||
// You can setup template engine before initiation app:
|
||||
app := fiber.New(&fiber.Settings{
|
||||
ViewEngine: "mustache",
|
||||
ViewFolder: "./views",
|
||||
ViewExtension: ".tmpl",
|
||||
TemplateEngine: "mustache",
|
||||
TemplateFolder: "./views",
|
||||
TemplateExtension: ".tmpl",
|
||||
})
|
||||
|
||||
// OR after initiation app at any convenient location:
|
||||
app.Settings.ViewEngine = "mustache"
|
||||
app.Settings.ViewFolder = "./views"
|
||||
app.Settings.ViewExtension = ".tmpl"
|
||||
app.Settings.TemplateEngine = "mustache"
|
||||
app.Settings.TemplateFolder = "./views"
|
||||
app.Settings.TemplateExtension = ".tmpl"
|
||||
|
||||
// And now, you can call template `./views/home.tmpl` like this:
|
||||
app.Get("/", func(c *fiber.Ctx) {
|
||||
|
|
Loading…
Reference in New Issue