internal/frontend : serve static assets (#392)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2019-11-22 17:46:01 -08:00 committed by GitHub
parent f20d913abe
commit ebee64b70b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 700 additions and 502 deletions

View file

@ -4,11 +4,12 @@ import (
"encoding/json"
"errors"
"fmt"
"html/template"
"io"
"net/http"
"github.com/pomerium/pomerium/internal/frontend"
"github.com/pomerium/pomerium/internal/log"
"github.com/pomerium/pomerium/internal/templates"
)
// Error formats creates a HTTP error with code, user friendly (and safe) error
@ -92,7 +93,7 @@ func ErrorResponse(w http.ResponseWriter, r *http.Request, e error) {
RequestID: requestID,
CanDebug: canDebug,
}
templates.New().ExecuteTemplate(w, "error.html", t)
template.Must(frontend.NewTemplates()).ExecuteTemplate(w, "error.html", t)
}
}