Skip to content

Configuration

albe194e edited this page Dec 25, 2024 · 6 revisions

##E Introduction RunicHttp supports multiple ways to make proper configurations for your http server. The purpose here is to enable you the developer to decide what makes sence for YOU and not the framework.

Supported ways to add configurations

  • Directly by instantiating the specific configuration struct with your desired values (e.g: Server_config):

sc : http.Server_config = {
        url = "127.0.0.1",
        port = 80
    }
  • Via a your own JSON files:

sc := http.load_config_from_file("server_config.json", .SERVER);

  • If not set, defualt values will be used

Defualt values can be found in src\config_defaults.odin


How to use custom files for configurations

Right now only JSON files are supported

  1. Create your JSON file. Location is irrelevant since you specify the path in the procedure.
  2. Add ONLY the desired config struct fields. JSON attributes that do not corresponds with a field in the struct will raise an error. Fields that are ignored will use defualt values.

Clone this wiki locally