///////////////////////////////////////////////////////////////////////////////

    Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

///////////////////////////////////////////////////////////////////////////////

= Configuring the Server
:description: Helidon MicroProfile server configuration
:keywords: helidon, microprofile, micro-profile

By default, the server uses the MicroProfile Config, but you may also want to use Helidon configuration.

== Configuring the Server

There are 3 default MicroProfile Config sources:

* `System.getProperties()`
* `System.getenv()` 
* all `META-INF/microprofile-config.properties` files on the class path

In this example, the configuration is in a file, and it includes Helidon configuration options.

[source,properties]
.META-INF/microprofile-config.properties - Server configuration
----
# default is localhost
server.host=some.host
# default is 7001
server.port=7011

# Helidon configuration (optional)

# Length of queue for incoming connections. Default is 1024
server.backlog: 512
# TCP receive window. Default is 0 to use implementation default
server.receive-buffer: 256
# Socket timeout milliseconds - defaults to 0 (infinite)
server.timeout: 30000
# Default is CPU_COUNT * 2
server.workers=4
# Default is not to use SSL
ssl:
 private-key:
    keystore-resource-path: "certificate.p12"
    keystore-passphrase: "abcd"
----


For Helidon config, the default file is `application.yaml` on the classpath
 (e.g. src/main/resources/application.yaml).

[source,yaml]
.application.yaml - Server configuration
----
server:
  sockets:
    - secure:
        port: 443
        # supports all socket related properties of server
        backlog: 1024
        receive-buffer: 0
        timeout: 60000
        ssl:
          ....
    - another:
        port: 12041
----
