1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00

examples: update the cors example to be easier for beginners

And update the pug view engine's vendor jade template engine to yesterday version 1 (tested and worked) to fix https://github.com/kataras/iris/issues/1125


Former-commit-id: 0ea7a8dd97ab13e5ecf984c379234cc671f5d84e
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-11-06 04:06:50 +02:00
parent d6964acfcd
commit 22782bbefe
7 changed files with 201 additions and 17 deletions

View File

@@ -32,7 +32,7 @@ type (
funcs map[string]interface{}
//
middleware func(name string, contents string) (string, error)
middleware func(name string, contents []byte) (string, error)
Templates *template.Template
//
}
@@ -266,7 +266,7 @@ func (s *HTMLEngine) loadDirectory() error {
tmpl := s.Templates.New(name)
tmpl.Option(s.options...)
if s.middleware != nil {
contents, err = s.middleware(name, contents)
contents, err = s.middleware(name, buf)
}
if err != nil {
templateErr = err
@@ -364,7 +364,7 @@ func (s *HTMLEngine) loadAssets() error {
tmpl.Option(s.options...)
if s.middleware != nil {
contents, err = s.middleware(name, contents)
contents, err = s.middleware(name, buf)
if err != nil {
templateErr = fmt.Errorf("%v for name '%s'", err, name)
continue