Another option, if this is a microservice where changes in configuration can 
come with a recompilation:
    
    
    const
      SERVER_HOST* {.strdefine.} = "localhost"
      SERVER_PORT* {.intdefine.} = 5000
    
    proc test {.gcsafe.} =
      echo (SERVER_HOST, SERVER_PORT)
    
    when isMainModule:
      test()
    
    
    Run

[compile-time define 
pragmas](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas)

Reply via email to