Thorium Server

Configuration File

Thorium uses the Typesafe Config Library for its configurations. Create the application.conf file under:

Default configurations can be found in the reference.conf files of the corresponding library. Thorium comes with its reference.conf file as well.

Configuration keys found in application.conf will override configurations in the reference.conf files.

Getting the config values

import com.greenfossil.thorium.{Action, Controller}
import com.linecorp.armeria.server.annotation.{Get, Param}
import com.typesafe.config.DefaultConfig

object SimpleController extends Controller:
  def checkEnv = Action: request =>
    val env = DefaultConfig().getString("app.env")
    Ok(s"Current environment is set to: [$env]")

Last modified on 22/11/2023, 3:53 pm