You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* added run tls
* setup run tls bool flag
* options update for tls config and files; server adjustments for tls
* serve updated after rebase
* removed RunTLS to simplify API and updated tests
* chore: typo fix for WithoutStartupMessages
* functional test for tls servers
* graceful shutdown for http server too
* moved TestServer_Run at the end of file above TestServer_RunTLS
* removed options add RunTLS back in; updated log messages with proto
* acme-tls example with certmagic (#1)
* certmagic poc
* add missing flag parse
* add with tls config from acme client
* listen on http too
* manage sync + https redir
* updated acme tls example
* acme tls update with comments
* remove debug log from acme-tls example
* acme-tls RunTLS
* chore: acme-tls comment update
* tls test without logger
* removed acme-tls example
Copy file name to clipboardExpand all lines: options.go
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ type Server struct {
42
42
// [http.ServeMux.Handle] can also be used to register routes.
43
43
Mux*http.ServeMux
44
44
45
-
// Not stored with the oter middlewares because it is a special case :
45
+
// Not stored with the other middlewares because it is a special case :
46
46
// it applies on routes that are not registered.
47
47
// For example, it allows OPTIONS /foo even if it is not declared (only GET /foo is declared).
48
48
corsMiddlewarefunc(http.Handler) http.Handler
@@ -68,14 +68,16 @@ type Server struct {
68
68
template*template.Template// TODO: use preparsed templates
69
69
70
70
DisallowUnknownFieldsbool// If true, the server will return an error if the request body contains unknown fields. Useful for quick debugging in development.
71
-
DisableOpenapibool// If true, the the routes within the server will not generate an openapi spec.
71
+
DisableOpenapibool// If true, the routes within the server will not generate an openapi spec.
72
72
maxBodySizeint64
73
73
Serializefunc(w http.ResponseWriter, ansany) // Used to serialize the response. Defaults to [SendJSON].
74
74
SerializeErrorfunc(w http.ResponseWriter, errerror) // Used to serialize the error response. Defaults to [SendJSONError].
75
75
ErrorHandlerfunc(errerror) error// Used to transform any error into a unified error type structure with status code. Defaults to [ErrorHandler]
76
76
startTime time.Time
77
77
78
78
OpenAPIConfigOpenAPIConfig
79
+
80
+
isTLSbool
79
81
}
80
82
81
83
// NewServer creates a new server with the given options.
slog.Debug("Server started in "+elapsed.String(), "info", "time between since server creation (fuego.NewServer) and server startup (fuego.Run). Depending on your implementation, there might be things that do not depend on fuego slowing start time")
33
-
slog.Info("Server running ✅ on http://"+s.Server.Addr, "started in", elapsed.String())
51
+
proto:="http"
52
+
ifs.isTLS {
53
+
proto="https"
54
+
}
55
+
slog.Info("Server running ✅ on "+proto+"://"+s.Server.Addr, "started in", elapsed.String())
0 commit comments