Simplistically, a server can be thought of as a collection of controllers composed with filters.
Additionally, a server can define modules for providing instances to the object graph and how to map exceptions to HTTP responses.

Finatra provides a default for the defaultHttpPort of ”:8888” which means that Finatra will
always attempt to start a non-ssl HTTP server on port 8888 if no other configuration is done. The
framework allows for users to specify starting an HTTPS server, either additionally or instead.

An HTTPS server can be started by passing in a value for the -https.port flag or overriding the
defaultHttpsPort with a non-empty value. To configure the underlying Finagle c.t.finagle.Http.Server
transport correctly, override the configureHttpsServer method in your HttpServer definition. E.g.,

As mentioned, the above configuration will still attempt to start a non-ssl HTTP server. To disable
the non-ssl HTTP server, override the defaultHttpPort value to an empty String (and do not
pass a value for the -http.port flag), e.g.,

The Finatra convention is to create a Scala object with a name ending in “Main” that extends your server class.
The server class can be used in testing as this allows your server to be instantiated multiple times in tests without worrying about static state persisting across test runs in the same JVM.
The static object, e.g., ExampleServerMain, which contains the static main method for the server would then be used as the application entry point for running the server in all other cases.

If you want to further configure the underlying Finagle server you can override configureHttpServer (or configureHttpsServer)
in your server to specify additional configuration on (or override the default configuration of) the underlying Finagle server.

To configure server-side Response Classification you could choose to
set the classifier directly on the underlying Finagle server by overriding the configureHttpServer (or configureHttpsServer) in your server, e.g.,

However, since the server-side ResponseClassifier could affect code not just at the Finagle level, we actually recommend overriding the specific framework module,
HttpResponseClassifierModule instead. This binds an instance of an HttpResponseClassifier
to the object graph that is then available to be injected into things like the HTTP StatsFilter
for a more accurate reporting of metrics that takes into account server-side response classification.