fup: don't crash on view if we don't have a cheddar

Classic Go typed-nil bug.
This commit is contained in:
Luke Granger-Brown 2021-03-26 21:44:13 +00:00
parent fa086419c8
commit d8e001922a

View file

@ -79,9 +79,11 @@ var (
AppRoot: viper.GetString("serve.app-root"),
StorageURL: bucketURL(),
RedirectToBlobstore: !viper.GetBool("serve.direct-only"),
Highlighter: highlighter,
AuthMiddleware: fuphttp.TokenAuthMiddleware(viper.GetString("serve.auth.token"), viper.GetString("serve.auth.realm")),
}
if highlighter != nil {
cfg.Highlighter = highlighter
}
a, err := fuphttp.New(ctx, cfg)
if err != nil {
return fmt.Errorf("constructing application: %w", err)